I have a grid and REST store (proxy type ‘rest’) with it. I need to send delete/put/post request to server, when changing store data.
Here is code of the store:
this.store = Ext.create('Ext.data.Store', {
model:this.model,
addCondition:function (key, value) {
this.proxy.extraParams[key] = value;
return this;
},
sorters:[
{
property:'NAME',
direction:'ASC'
}
],
proxy:{
storeId:'storemicorid',
type:'rest',
extraParams:{
model:this.model
},
url:document.head.baseURI + 'rest',
/*api:{ //tried this too
read:document.head.baseURI + 'rest',
create:document.head.baseURI + 'rest',
destroy:document.head.baseURI + 'restd',
update:document.head.baseURI + 'rest'
},*/
reader: {
type: 'json',
root: 'data'
},
writer: {
type: 'json',
encode: true,
root: 'data'
},
actionMethods:{
create: "POST",
destroy: "DELETE",
read: "GET",
update: "PUT"
}
}
});
When I delete any record
clientgrid.store.remove(selection);
there are no request to server. Grid can load data, but doesn’t call server. Tried ajax and rest store, tried change writers, actionMethods, urls and api… Can’t find the reason.. Help please…
Did you try to set the attribute
autoSync:true;? Maybe it helps.