Page 1 of 1

adding theme and text to ajax loader globally

Posted: Mon May 12, 2014 12:38 pm
by ciccio

I added my custom ajax loader to some page by adding

code$.mobile.loading( "show", { text: "Caricamento in corso...", textonly: false, textVisible: true, theme: "a", html: ""});/code
on the page show event of the page and hiding it with " hideSpinner();"

it works but i would like to set for every ajax call the same ajax loader.

is there a way to set globally my custom ajax loader working for every page, and every ajax call so i do not have to add the code to every pages?


adding theme and text to ajax loader globally

Posted: Mon May 12, 2014 4:02 pm
by Evgene Karachevtsev

Hello,

Here is how to make custom Ajax status: http://docs.appery.io/documentation/b...


adding theme and text to ajax loader globally

Posted: Tue May 13, 2014 12:58 am
by ciccio

I read the doc you suggested but i can not figure out how it can help me in showing some text when the loader is running.
I do not want to change the spinner image. In the code i posted i'using the default spinner but i chose the jquery mobile theme and added some text like "loading...". It is something like the loader appery run on its own tester while a user login and the list of project is loaded. I would like to know if it is possible to add any code to change the loader spinner for every ajax call to obtAin the result i get with the code i previously posted in every page instead of the default spinner


adding theme and text to ajax loader globally

Posted: Tue May 13, 2014 4:13 pm
by Evgene Karachevtsev

Hello,

Please look for information here: https://getsatisfaction.com/apperyio/...


adding theme and text to ajax loader globally

Posted: Wed May 14, 2014 6:48 am
by ciccio

I started from that post and i added the custom loader with text on some event in some page of my project but i would like to know if it is possible to add any code in any way to have the ajax loader with text working globally so i do not have to add the same code for every event


adding theme and text to ajax loader globally

Posted: Wed May 14, 2014 7:02 pm
by Evgene Karachevtsev

Hello,

There is function showSpinner in file "file/resources/js/mobilebase.js". You can change it to show you message for all requests.
For example instead of this piece of javascript code

code
if (loaderOptions != undefined) {
$.mobile.loading('show', loaderOptions);
} else {
$.mobile.loading('show');
}
/code
use this javascript code:

code
if (loaderOptions != undefined) {
$.mobile.loading('show', loaderOptions);
} else {
loaderOptions={text:"asdasd",
textVisible: true};
$.mobile.loading('show', loaderOptions);
} /code