ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

adding theme and text to ajax loader globally

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?

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

adding theme and text to ajax loader globally

Hello,

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

ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

adding theme and text to ajax loader globally

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

ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

adding theme and text to ajax loader globally

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

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

adding theme and text to ajax loader globally

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

Return to “Issues”