I have an interesting situation. I am creating an Enhanced Datagrid (ith about 24000 entries). So I am planning to load a small subset to display some data to user while another request finishes. you can see what I am trying to do in code below. Now issue is, both these functions in "load" will update grid datastore. I want to make sure that updateDataStore() from second xhrGet is called ONLY after createDataStore() is finished. This is required because I am creating ids dynamically for rows in data store. I do not want to hold second xhrGET request till first xhrGET is completed.
** code to update store**
var ds = dijit.byId("grid").store; ds.newItem();
code to create grid and make two xhrGET requests
CreateEmptyGrid();
dojo.require("dojo._base.xhr");
dojo.xhrGet({
url:"url1",
handleAs:"json",
load: function(data){createDataStore(data);
}
});
dojo.xhrGet(
{
url:"url2",
handleAs:"json",
load: function(data){updateDataStore(data);}
});