Page 1 of 1

JS Routine to load variables: How to change a label at start and get it displayed

Posted: Thu Feb 27, 2014 11:32 am
by Andy Parker

Hi,

I have a JS routine that is responsible for building a dynamic list from local storage and have a status label that needs to display "Building..." at the start of the routine and "Completed" at the end.

Currently I use the following code to set the label:

Appery("jlabel").text("Building....");

and the same sort of code to set it to "Completed"

I never see the label set to "Building" at all, even though the load can take several seconds on a slower device.

I presume this is because the JS routine does not allow UI update while it runs. I even tried: Appery("jlabel").refresh(); but this doesn't do anything.

Is there a way to force the UI to update inside of the JS routine?

regards

Andy


JS Routine to load variables: How to change a label at start and get it displayed

Posted: Thu Feb 27, 2014 12:11 pm
by Maryna Brodina

Hello! Try to invoke your code on timeout: preAppery("jlabel").text("Building....");
setTimeout(function(){
//here is your code
Appery("jlabel").text("Completed");
}, 10);/pre