How can I send my entire store data to the server in one POST call? It could be in json format.
thanks.
Update:
this is my store code:
Ext.define('App.store.consultorio.Receita', {
extend: 'Ext.data.Store',
model: 'App.model.consultorio.Receita',
autoLoad: false,
proxy: {
type: 'rest',
reader: {
type: 'json'
},
writer: {
type: 'json'
},
url: 'consultas/receita.json'
}
});
You could set every record in the store dirty, then call sync()
store.each(function(record){
record.setDirty();
});
store.sync();
Also, your store is using a RESTful proxy, which by default does not batch actions. See http://docs.sencha.com/ext-js/4-2/#!/api/Ext.data.proxy.Rest-cfg-batchActions
Your store should look like:
Ext.define('App.store.consultorio.Receita', {
extend: 'Ext.data.Store',
model: 'App.model.consultorio.Receita',
autoLoad: false,
proxy: {
type: 'rest',
batchActions: true, //<------
reader: {
type: 'json'
},
writer: {
type: 'json'
},
url: 'consultas/receita.json'
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With