我是 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'
}
}
}
});