PDA

View Full Version : [CLOSED] Get Gridpanel's Store data from code Behind without sending values as parameters



AdminAISN
Nov 15, 2013, 5:09 PM
Hi I would like to get a gridpanel's store data or items from code behind. I don't want to datas as parameter because the method that have to get this values is not in the same page.
Somebody can help me?

Baidaly
Nov 16, 2013, 12:33 AM
Hello!

As a Premium member you need to post your thread to the Premium Forums. The thread has been moved to the 2.x Premium Help forum.

About your question, where do you send your data? Is it handler or WebService. However, the only way to send the Grid's data to the server is to use parameters. But how you handle them depends on what and where is the handler.

AdminAISN
Nov 18, 2013, 8:52 AM
The page containning the gridpanel is a step of a wizard.
Which kind of event should i fire in order to get the gridpanel datas at the end of the wizard? Thoses datas should be sent to the page codebehind in order to build specific objects that will be used later!

Thanks.

Daniil
Nov 18, 2013, 11:24 AM
Which kind of event should i fire in order to get the gridpanel datas at the end of the wizard?

What do you mean under "end of the wizard"? When a user press the "Finish" button? So, you should get the GridPanel's data on clicking that Finish button. Please clarify are you in trouble to access the GridPanel on the final wizard step? If so, we should know a bit more about the design of your wizard.

Baidaly
Nov 18, 2013, 11:48 PM
The page containning the gridpanel is a step of a wizard.
Which kind of event should i fire in order to get the gridpanel datas at the end of the wizard? Thoses datas should be sent to the page codebehind in order to build specific objects that will be used later!

Thanks.

You can save the Grid's data into some hidden field or send it as ExtraParam directly. To get the Grid's values you should use getRowsValues function:


// config :
// - selectedOnly
// - visibleOnly
// - dirtyCellsOnly
// - dirtyRowsOnly
// - currentPageOnly
// - excludeId
// - filterRecord - function (record) - return false to exclude the record
// - filterField - function (record, fieldName, value) - return false to exclude the field for particular record
getRowsValues : function (config) {

If it doesn't clear, could you say how your wizard is organized? I mean do you use CardLayout, how do you want to send your data to the server?

AdminAISN
Jan 23, 2014, 10:15 AM
You can save the Grid's data into some hidden field or send it as ExtraParam directly. To get the Grid's values you should use getRowsValues function:


// config :
// - selectedOnly
// - visibleOnly
// - dirtyCellsOnly
// - dirtyRowsOnly
// - currentPageOnly
// - excludeId
// - filterRecord - function (record) - return false to exclude the record
// - filterField - function (record, fieldName, value) - return false to exclude the field for particular record
getRowsValues : function (config) {

If it doesn't clear, could you say how your wizard is organized? I mean do you use CardLayout, how do you want to send your data to the server?

I used Javascript method to send data from Client page to server's directMethod.

Daniil
Jan 23, 2014, 11:38 AM
Thank you for the update.

By the way, here is an example.
http://examples2.ext.net/#/GridPanel/Miscellaneous/Submit_Two_Grids/

zhangkaihua
Apr 19, 2014, 4:46 PM
I used Javascript method to send data from Client page to server's directMethod.


in the javascrip,we can pass data like this:

MyDirectMethod.MyFunction(gridPanel1.getRowsValues ());

in the codebehind,we can like this:


MyFunction(Object obj)
{
string jsonText = obj.ToString();
JArray ja = (JArray)JsonConvert.DeserializeObject(jsonText);
......
}

Daniil
Apr 22, 2014, 7:42 PM
Hi @zhangkaihua,

Thank you for sharing that information.