PDA

View Full Version : Load Data to a grid from another function



evs.saad
14 Dec 2012, 3:38 AM
Hi,
I have a store that is in variable gridPanel. Now I am calling a function and a popup appears on that function. The user selects options and the options returns values successfully the way I want but I am unable to load the data to gridPanel. I have tried to use
Ext.getCmp('gridPanle').loadData(results); but it is not working. Can any one suggest me that how can I load data to my grid. My code looks something like this


var gridPanel = //code here for grid panel

function search()
{
// the other code for the search function goes here
success: function(f, a) {

Ext.getCmp('gridPanel').loadData(results); // here I want to append data to gridPanel and the result is returned json encoded with results like {"success:true",
"results":[{""}]} Now I want to load the returned results to gridPanel. Any idea how this can be done}
win.close();
}
}



Thanks in advance

mitchellsimoens
16 Dec 2012, 9:31 AM
The grid will display the data in the store so you should interact with the store not the grid for data.

evs.saad
17 Dec 2012, 3:57 AM
I know I have to assign the values to store. I have saved my store in a variable orderGridStore. Now I want to load the returned result to this store, how can I do that. I have searched a lot but could not find any help or may be I am searching wrong can you please guide me.
Thanks