【发布时间】:2012-03-03 17:39:20
【问题描述】:
我正在尝试让 EXT JSON 存储使用 JSON 发送数据,但它似乎不起作用。 这是简单的代码:
var myStore = new Ext.data.Store({
//model: 'User',
proxy: {
type: 'ajax',
url: '/users.svc',
reader: {
type: 'json',
root: 'users'
},
writer: {
type: 'json',
root: 'data'
},
actionMethods: {
create: 'POST', read: 'POST', update: 'POST', destroy: 'POST'
},
extraParams: { test: 'test' }
},
listeners: {
beforeload: function (store, operation, options) {
//alert(operation.params);
}
},
autoLoad: true
});
由于我定义了 JSON“编写器”,我期望参数将使用 JSON 发送到服务器。
但是,它仍在使用以下正文进行常规 POST:
test=test&page=1&start=0&limit=25
虽然我的期望是 POST 应该有以下正文:{test:'test',page:1,start:0}
如果有任何帮助,我将不胜感激
附:我正在使用 EXTJS 4.0.7
【问题讨论】:
标签: javascript json extjs extjs4 http-post