【发布时间】:2013-04-09 13:19:01
【问题描述】:
我是 sencha touch2 的新手,我有 Ajax Post Request 代理,并且能够获取 Json 数据。但是我的成功和失败函数没有被调用?知道我该怎么做吗? 这是我的模型供您参考:
Ext.define('TestApp.model.ModelList', {
extend: 'Ext.data.Model',
xtype:'modelList',
config: {
fields:['work'],
proxy:{
type:'ajax',
method: 'POST',
url:'http://localhost:9090/apps/works',
callbackKey: 'callback',
actionMethods: {
create : 'POST',
read : 'POST', // by default GET
update : 'POST',
destroy: 'POST'
},
headers: {
'Content-Type': 'application/xml',
'Accept':'application/json'
},
callback: function(options, success, response) {
console.log('999999999'+response.responseText);// not getting called
},
success: function(response) {
console.log('success++++');// not getting called
},
failure: function(response) {
console.log('failure++++');// not getting called
},
reader:
{
type:'json'
}
}
}
});
【问题讨论】:
-
使用 Chrome 开发者工具。打开网络选项卡。重新加载您的页面或触发您的请求。查看网络流量。会发生什么?
-
服务器返回什么?
-
下面的答案有帮助吗?
标签: ajax extjs extjs4 sencha-touch sencha-touch-2