The default ajax spinner for REST services (which I don't mind using) freezes half way through the service request. Any way to get that working smoothly?
The default ajax spinner for REST services (which I don't mind using) freezes half way through the service request. Any way to get that working smoothly?
Hello!
Could you please send us screenshot?
Check the browser console for any error.
There are no errors, the service executes correctly, just the .gif is frozen. Also, it works almost flawlessly in the simulator (sorry I forgot to mention that). Here is a screenshot from my phone (iPhone 5, ios 6.1.4).
(names are fake)
Please look at a simmilar question https://getsatisfaction.com/apperyio/...
Thanks, I've seen been on this thread. The solution provided is a workaround that requires adding a custom ajax spinner each time you call a service. I have about 50 services set up and it would be nice to fix the one currently in place ![]()
If not, it's not the end of the world. I would make a suggestion to add the ability to include a custom spinner for REST services, or at least one made in css and not a gif. I don't know if anyone else would appreciate it, but I know it would sure save me time ![]()
Hello! If you want to implement CSS spinner this should help http://cssload.net/
Thanks for he help Marina and Alena, I ended up modifying Neil's code from https://getsatisfaction.com/apperyio/... and came up with this...
code
var spinner = new Object();
//show spinner or create one
spinner.show = function(target)//requires page object, I usually use $('.ui-page-active') for current page
{
try
{
if(target.find('.SpinnerAdd').length <= 0)//if spinner has not been created
{
$('<div class="SpinnerAdd" align="center"><div></div><div></div><div></div></div>').prependTo(target).css({'margin':'-26px','position':'absolute','right':'50%','top':'45%','z-index':'2002'});//create spinner
}
else
{
$('.SpinnerAdd').show();//show spinner
}
}
catch(err)
{
console.log("spinner.show: " + err);
}
}
Code: Select all
//show backdrop or create one
spinner.backdrop = function(target)//requires page object, I usually use $('.ui-page-active') for current page
{
try
{
if(target.find('.Backdrop').length <= 0)//if backdrop has not been created
{
$('<div class="Backdrop"/>').prependTo(target).css({'background-color':'black','opacity':'0.8','width':'100%','height':'200%','top':'0px','position':'absolute','z-index':'2000'});//create backdrop
}
else
{
$('.Backdrop').show();//show backdrop
}
}
catch(err)
{
console.log("spinner.backdrop: " + err);
}
}
//hide spinner and backdrop
spinner.hide = function()
{
try
{
$('.Backdrop').hide();//remove backdrop
$('.SpinnerAdd').hide(); //remove spinner
}
catch(err)
{
console.log("spinner.hide: " + err);
}
} /code
use...
code
spinner.show(page object); //show spinner
spinner.backdrop(page object); //show backdrop
spinner.hide(); //hide spinner and backdrop
/code