5
我是新来EXTJS,并有一个问题, 这是我的商店试图赶上302状态的Ext JS
someStore = new Ext.data.JsonStore({
root: 'results',
proxy: new My.HttpProxy({
url: '/cityList',
method: 'POST'
}),
fields: ['id','name']
});
当我得到和Id我需要通过ID someStore.reload重装店({PARAMS:{someId:someId}});
它的工作原理normaly如果我使用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});
}
}
};
也
My.HttpProxy = Ext.extend(Ext.data.HttpProxy, {
doRequest : function(action, rs, params, reader, cb, scope, arg) {
....
if(this.useAjax){
Ext.applyIf(o, this.conn);
if (this.activeRequest[action]) {
}
this.activeRequest[action] = **My.Ajax.proxyRequest(o);**
问题是我得到的响应与我需要的数据,但存储不重新加载数据可能是JsonStore有特定的回调?