我打电话跟我煎茶触摸手机应用程序的网络服务:诊断空店负载
Ext.regModel('BaseResponse', {
idProperty: 'ResponseTime',
fields: [
{ name: 'ErrorMessage', type: 'string' },
{ name: 'ResponseTime', type: 'date', dateFormat: 'c' },
{ name: 'StatusCode', type: 'string' },
{ name: 'Success', type: 'string' }
]
});
var declineResult = new Ext.regStore('declineResult',
{
model: 'BaseResponse',
proxy : {
type : 'ajax',
dataType: "json",
url : App.BaseURL + '/SetJobResponse/' + options.jobId + '/' + STCID +'/' + options.OJSStatusID + '/' + device.uuid,
reader: new Ext.data.JsonReader ({
type: 'json'
})
},
listeners:
{
'load': function(store,records,successful)
{
alert(records.length);
//alert('response message:' + Ext.StoreMgr.get("declineResult").getAt(0).ErrorMessage);
},
'loadexception': function()
{
alert('There was a load exception');
}
}
});
Ext.StoreMgr.get("declineResult").load();
这里的JSON由URL返回如果我只是浏览到它:
{"ErrorMessage":"You are not authorised","ResponseTime":"\/Date(1321447985287)\/","StatusCode":401,"Success":false}
然而即使我的加载事件显示Successful = true,记录也是空的(长度为0)。 异常事件未被触发。 如何进一步诊断?我使用Sencha Touch和带有Android模拟器的Phonegap使用Eclipse。有什么方法可以查看返回的内容吗?