PDA

View Full Version : I need to handle grid data using java and json



bothman
22 May 2016, 1:07 AM
I n my application I need to handle data form grid (I don't need to save it in data base bt I need to handle it using java code)
I am using ajax and pass the data as parameters

Ext.Ajax.request({
url: 'myUrl',


params: {
I need to pass the grid parameters here
},


callback: function(options, success, response) {
console.log(response.responseText);
}
});

how can I get the data from the grid?
and what is the type of the receiving data in java code?
thanks

jdkhamba
22 May 2016, 2:47 AM
Data in the grid is bound to the store of the grid Simply get the data from the store using the getData() call of the store's model.Something like:



var data = [];
Ext.each(grid.getStore().getRange(),function(rec){
data.push(rec.getData(true));// to get associated data as well.

});