Folks,
I believe the function I need to use is .queue though am open to alternative suggestions. My attempts to resolve this so far have failed, hence why I am here :)
InitData()
Contains an ajax call and successfully retrieves data via JSON and stores it locally with .data()
I have tested and can confirm the data is read, saved and available.
DrawScreen()
Draws table #sui and dynamically applies cells, buttons, text boxes.
Problem:
I got a chicken/egg sort of thing - the data cannot be displayed if the screen has not completed its draw, and when drawn, it cannot display data that it does not yet have... Sometimes my data is read faster from my local hosted database than drawing the screen (the amount of data at this moment is small, and the database is hosted with apache on the same laptop that has the browser).
I welcome all help! Various attempts prove to be unreliable solutions, including variations of $(document).ready() and $(document).load()
$(document).ready( function()
{
InitData();
DrawScreen();
}
How can I create an event that is executed only when the above two functions have completed? Do I use .queue() or something else? I have made it work by inserting delays, but I think this is a dirty workround...
All help appreciated...