kilrae
7 Jul 2007, 10:47 AM
I have two combo boxes that load their contents via an HTTPProxy.
If the HttpProxy is given a Connection config object literal and the first request has not finished before the second one begins, the first request is aborted. If I pass Connection objects rather than configs, it works fine.
HttpProxy.load in HttpProxy.js contains this:
if(this.useAjax){
Ext.applyIf(o, this.conn);
if(this.activeRequest){
Ext.Ajax.abort(this.activeRequest);
}
this.activeRequest = Ext.Ajax.request(o);
}else{
this.conn.request(o);
}
Using a connection object skips the activeRequest check. Perhaps this is a scope issue. The two HttpProxies are separate objects, so it shouldn't happen but it does. This is the code I am using that doesn't work:
var lawyerDS = new Ext.data.Store({
"proxy": new Ext.data.HttpProxy({"url": "/control/lawyer-list", "method": "GET" }),
"reader": new Ext.data.JsonReader({
"root": "records",
"totalProperty": "totalCount",
"id": "id"
}, [{"name": "id"},{"name": "Name"}]),
"baseParams": {"fields": Ext.util.JSON.encode(["id","Name"])}
});
lawyerDS.load();
var courtDS = new Ext.data.Store({
"proxy": new Ext.data.HttpProxy({"url": "/control/court-list", "method": "GET" }),
"reader": new Ext.data.JsonReader({
"root": "records",
"totalProperty": "totalCount",
"id": "id"
}, [{"name": "id"},{"name": "shortname"}])
});
courtDS.load();
It works if one of the HttpProxies is passed something like new Ext.data.Connection({"url": "control/lawyer-list"})
If the HttpProxy is given a Connection config object literal and the first request has not finished before the second one begins, the first request is aborted. If I pass Connection objects rather than configs, it works fine.
HttpProxy.load in HttpProxy.js contains this:
if(this.useAjax){
Ext.applyIf(o, this.conn);
if(this.activeRequest){
Ext.Ajax.abort(this.activeRequest);
}
this.activeRequest = Ext.Ajax.request(o);
}else{
this.conn.request(o);
}
Using a connection object skips the activeRequest check. Perhaps this is a scope issue. The two HttpProxies are separate objects, so it shouldn't happen but it does. This is the code I am using that doesn't work:
var lawyerDS = new Ext.data.Store({
"proxy": new Ext.data.HttpProxy({"url": "/control/lawyer-list", "method": "GET" }),
"reader": new Ext.data.JsonReader({
"root": "records",
"totalProperty": "totalCount",
"id": "id"
}, [{"name": "id"},{"name": "Name"}]),
"baseParams": {"fields": Ext.util.JSON.encode(["id","Name"])}
});
lawyerDS.load();
var courtDS = new Ext.data.Store({
"proxy": new Ext.data.HttpProxy({"url": "/control/court-list", "method": "GET" }),
"reader": new Ext.data.JsonReader({
"root": "records",
"totalProperty": "totalCount",
"id": "id"
}, [{"name": "id"},{"name": "shortname"}])
});
courtDS.load();
It works if one of the HttpProxies is passed something like new Ext.data.Connection({"url": "control/lawyer-list"})