Page 1 of 1

Load Local Storage Variable Before Chart

Posted: Mon Jul 28, 2014 11:12 am
by Paul Medawar

Hi,

I have a list of names, and when one is clicked the name is stored to a local storage variable and the app navigates to another screen.

This screen is populated by a chart, which uses JS in service success event to populate a chart.

The problem is that the chart is always populated with the previous Local Storage Variable rather than the one just clicked.

How can I make sure that the chart loads after the service uses the new local storage variable, rather than the previous one?

thanks


Load Local Storage Variable Before Chart

Posted: Mon Jul 28, 2014 12:26 pm
by Evgene Karachevtsev

Hello Paul,

You should check the sequence of operation of actions. You can change their order by clicking on the arrow in the list of events


Load Local Storage Variable Before Chart

Posted: Mon Jul 28, 2014 12:43 pm
by Paul Medawar

Hi Evgene,

here is my sequence with 4 invoking the service and 9 running the JS for the Jqplot...so not sure that is the problem?

Image


Load Local Storage Variable Before Chart

Posted: Mon Jul 28, 2014 9:28 pm
by obullei

Hello!

If it is necessary for you to execute one service after another, it is better to execute the second service on event "complete" of the first service. This will ensure the exact order of sending queries


Load Local Storage Variable Before Chart

Posted: Tue Jul 29, 2014 6:51 am
by Paul Medawar

Thanks Arina