Page 1 of 1

Stopping Resume Event

Posted: Thu Oct 26, 2017 4:08 pm
by Paul Medawar

Hi,

if the "resume" event is used to invoke a service on a page, does that mean the service will be invoked every time the app is resumed after that?

I have an app with three pages. I want to run the "resume" event to invoke a service on page 2, but I don't want it to continue to fire on resuming when in page 1 or Page 3.


Stopping Resume Event

Posted: Fri Oct 27, 2017 7:54 am
by Serhii Kulibaba

Hello Paul,

Please add that function to the page2 for that


Stopping Resume Event

Posted: Fri Oct 27, 2017 7:57 am
by Paul Medawar

Hi Serhii,

I have added the function on to page 2 and it works great. However, after navigating from page 2, to page 1 or 3, the function is still firing on resume. How can I stop it and make sure it only fires on page 2?


Stopping Resume Event

Posted: Sat Oct 28, 2017 12:37 pm
by Serhii Kulibaba

You can check the active page with JS and run that function if the pageName = Page2. Please use JS below:preif($($(".ui-page-active")[0]).attr("id")==="Page2"){
alert("test");
}/pre


Stopping Resume Event

Posted: Tue Jan 09, 2018 6:08 am
by Paul Medawar

Hi Serhii,

just came back to this and it worked perfectly, thanks!