Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Spinner disappearance for cascaded services

I have a sequence of services on a page, and each service is completed on success of prior one. The issue is that the loading spinner appears momentarily and does not stay on till the last of the services is successfully executed, causing user experience glitch.

As suggested here (https://getsatisfaction.com/apperyio/...) I have inserted showSpinner() on page show and add hideSpinner at the success of very last service, but this has no effect.

How can this be fixed?
Regards

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Spinner disappearance for cascaded services

Hi Cody,

Please use following JS code to invoke service on the service "success" event.

pre

var onDelay = function(){
//Where "restservice1" is your service datasource name.
restservice1.execute();
};

window.setTimeout(onDelay, 1);

/pre

Also - don't forget to remove code you wrote before for this goal.

Regards.

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Spinner disappearance for cascaded services

Hi Yurii,

This is a clever solution. However, I am noticing discontinuity especially when tested on device and it is more severe under poor network connectivity scenarios: i.e, a spinner appears and disappears and the next one appears and disappears and so on. Is there a more seamless way to handle this issue?

Regards.

PS - I don't think this influences the case in hand, but the scenario I have more specifically uses your recommendation as below:

// the following executed on success of restService0

code
setTimeout(function() {onDelay(data);}, 1);

function onDelay(data){
//some code here

if (boolean)
restservice1.execute();
else
restservice2.execute();
}

/code

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

Spinner disappearance for cascaded services

Hi Cody,

1) You can attach your own progress bar
2) Please try to override existing progress bar with your function

Since you know how long is the chain, you can trigger filling progress

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Spinner disappearance for cascaded services

Hi Ihor,

I had gone through elaborate discussion here regarding overriding, and was advised to instead use showSpinner() and hideSpinner() functions to achieve what I want:
https://getsatisfaction.com/apperyio/...

Unfortunately this does not work in that the spinner is not invoked and closed on demand with these two functions.

How do you suggest I achieve what your are suggesting?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Spinner disappearance for cascaded services

Hello Cody,

We are very sorry for delay, we are working on your request and try to post and update later today.

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

Spinner disappearance for cascaded services

Hello,

showSpinner is function only. If you open console and write it and run it you will see
http://gyazo.com/f007f98ac905d6a90e59...
this means that you can override it like any other functions

showSpinner = function(){
/// place your spinner here
}

Return to “Issues”