Send all Extjs store entries to the server at once

How can I send my entire storage data to the server in one POST call? It may 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' } }); 
+4
source share
1 answer

You can set each entry in the repository dirty, then call synchronization ()

 store.each(function(record){ record.setDirty(); }); store.sync(); 

In addition, your store uses a RESTful proxy, which by default does not perform batch actions. See http://docs.sencha.com/ext-js/4-2/#!/api/Ext.data.proxy.Rest-cfg-batchActions

Your store should look like this:

 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' } }); 
+4
source

All Articles