我是EXTJS的新手,有问题,这是我的商店
someStore = new Ext.data.JsonStore({
root: 'results',
proxy: new My.HttpProxy({
url: '/cityList',
method: 'POST'
}),
fields: ['id','name']
});
Run Code Online (Sandbox Code Playgroud)
当我得到并且我需要通过id someStore.reload({params:{someId:someId}})重新加载商店;
如果我使用Ext.data.HttpProxy,它的工作正常,但我需要捕获302并做一些处理它,
My.Ajax = {
proxyRequest: function(o){
this.cbOutSide = o.callback;
o.callback = this.cb;
Ext.Ajax.request(o);
}...
cb: function(options, success, response) {
....
if (response.status == 200) {
var resObj = Ext.util.JSON.decode(response.responseText);
this.cbOutSide(resObj);
}
if (response.status == 302) {
Ext.Msg.show({title: '...',msg: 'Time OUT!',
buttons: Ext.Msg.OK, icon: Ext.MessageBox.ERROR});
}
}
};
Run Code Online (Sandbox Code Playgroud)
并且
My.HttpProxy = Ext.extend( Ext.data.HttpProxy, {
doRequest : function(action, rs, params, reader, cb, …Run Code Online (Sandbox Code Playgroud)