休息存储不在服务器上发送请求
我有一个网格和 REST 存储(代理类型“rest”)。更改商店数据时,我需要向服务器发送删除/放置/发布请求。 这是商店的代码:
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"
}
}
});
当我删除任何记录时
clientgrid.store.remove(selection);
没有对服务器的请求。 Grid可以加载数据,但不调用服务器。尝试过ajax和rest商店,尝试更改writers、actionMethods、urls和< strong>api...找不到原因..请帮忙...
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试设置属性
autoSync:true;
?也许有帮助。Did you try to set the attribute
autoSync:true;
? Maybe it helps.