So how I can control the page contents loading sequence in dojo

Posted by David Zhao on Stack Overflow See other posts from Stack Overflow or by David Zhao
Published on 2009-11-20T01:16:37Z Indexed on 2010/04/14 16:03 UTC
Read the original article Hit count: 452

Filed under:
|

Hi there,

I'm using dojo for our UI's, and would like to load certain part of page contents in sequence. For example, for a certain stock, I'd like to load stock general information, such as ticker, company name, key stats, etc. and a grid with the last 30 days open/close prices. Different contents will be fetched from the server separately. Now, I'd like first load the grid so the user can have something to look at, then, say, start loading of key stats which is a large data set takes longer time to load. How do I do this. I tried: dojo.addOnLoad(function() {

startGrid(); //mock grid startup function which works fine getKeyStats(); //mock key stat getter function also works fine });

But dojo is loading getKeyStats(), then startGrid() here for some reason, and sequence doesn't seem be matter here. So how I can control the loading sequence at will? Thanks in advance!

David

© Stack Overflow or respective owner

Related posts about dojo

Related posts about loading