PDA

View Full Version : ExtJS Direct Mutiple Calls to Same Function?



cgountanis
6 Nov 2009, 8:57 AM
Using the code below I should get 2 AJAX calls with 2 returns. It seems the last one in line is the one that runs. Is there a way to run the same function with params inline at same time. I am sure you can see the reasons. Depending on the siteType it returns different string. Can someone help me with this please?



var siteType = "";

//testing calling function with return
siteType = '1';
Sample.GetLayers(siteType, function(e, o)
{
console.log(o.result);
});

siteType = '2';
Sample.GetLayers(siteType, function(e, o)
{
console.log(o.result);
});

crp_spaeth
11 Nov 2009, 8:08 AM
Both method calls should get executed. But you may end up with one Ajax request which transports both requests.

If thats not what you want it to do (which you should) you can set "enableBuffer" of the remoting provider to false.

cgountanis
13 Nov 2009, 6:21 AM
Both do not run firebug only shows one call but it seems to be the last one in line that gets executed. Is this a bug?