更新时间:2023-02-24 08:00:37
method:'POST'
无法正常工作.没有这样的配置选项.但是,有两种方法可以使商店使用POST
.最简单的一个-只需覆盖getMethod
函数:
method:'POST'
in proxy's config won't work. There is no such config option. However there are two ways to make store use POST
. The simplier one - just override getMethod
function:
var content_type_store = new Ext.data.Store({
proxy: {
type: 'ajax',
url: BASE_URL+'questions/content_pie',
extraParams :{hi:''},
// Here Magic comes
getMethod: function(request){ return 'POST'; }
},
reader: {
type: 'json',
root: 'results'
}
});
第二种方式:覆盖代理的actionMethods
属性.如果您选择这种方式,则代理应如下所示:
The second way: override proxy's actionMethods
property. If you choose this way your proxy should look like this:
// ...
proxy: {
type: 'ajax',
url: BASE_URL+'questions/content_pie',
extraParams :{hi:''},
// Here Magic comes
actionMethods: {
create : 'POST',
read : 'POST',
update : 'POST',
destroy: 'POST'
}
},
// ...