As do to send all the data in a grid in extjs to the server?
My Store
var store = Ext.create('Ext.data.Store', {
autoDestroy: true,
autoLoad: true,
fields: ['property', 'value']
proxy: {
type: 'ajax',
url: '...',
reader: {
type: 'json'
},
writer: {
url: '...',
}
},
sorters: [{
property: 'common',
direction:'ASC'
}]
});
I have a grid that uses my store.
I have tried to this but it doesn’t work
mygrid.getStore().add(mygrid.getStore().getRange(0,2));
any ideas?
You defined your store as a variable ‘store’. So you would just need to call
store.save(). The save function will use the url defined by your store.proxy to post the data back to the database.I noticed that you are putting a
urlconfig inside of yourproxy.writer, which doesn’t have a url config option.proxy.writeris used to translate the json, xml, etc before it gets to the proxy.If you want to use different backend controllers for CRUD operations you could specify these in the
apiconfig of the proxy you are using (Ext.data.proxy.Ajax). Take a look at theapiconfig item on this page.