I am new to EXTJs and have a problem, this is my store
someStore = new Ext.data.JsonStore({
root: 'results',
proxy: new My.HttpProxy({
url: '/cityList',
method: 'POST'
}),
fields: ['id','name']
});
when I get and Id, I need to reboot the storage by id someStore.reload ({PARAMS: {someId: someId}});
it works fine if I use Ext.data.HttpProxy, but I need to catch 302 and do something with it,
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});
}
}
};
and
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);**
the problem is that I get a response with the data that I need, but the storage does not reload with data. Maybe JsonStore has a specific callback?