I am trying to get values from a grid in my c# controller. This is my store and grid
Ext.create('Ext.data.Store', {
storeId:'store',
fields:['name', 'email', 'phone'],
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});
Ext.create('Ext.grid.Panel', {
store: Ext.data.StoreManager.lookup('store'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});
This is how I am trying to pass my grid values to the controller
var records = [];
this.store.data.each(function(rec) {
records.push(rec.data);
});
Ext.Ajax.request({
url: 'mycontroller/read_grid',
params: {
par1: Ext.encode(records)
}
})
my problem is how do I get all the values from column phone to update my sql database. Do i use some kind of array or is there a method to get all the values of column "phone" to store in database