app.preloader.show('multi');
app.request.json('http://URL/wp-json/wp/v2/ixxx?orderby=title&order=asc&per_page=100&page=1&_embed', function (insumosdata) {
app.preloader.hide();
But when I enter the page the request is, it shows nothing, i got to go back and enter again.
The request is for a virtual-list, it got 100 items.
How can I keep for longer the preloader, although it is fictional.
have you tried with this?
app.preloader.show();
setTimeout(function () {
app.preloader.hide();
}, 3000);
Or you can listen to the event itemsAfterInsert and hide the preloader there.
https://framework7.io/docs/virtual-list.html#virtual-list-events
Thanks for the responses i’m gonna try.
I can’t make it work. I put this on app init. insumoslist is the virtual list.
var app = new Framework7({
...
on: {
vlItemsAfterInsert: function (insumoslist, fragment) {
app.preloader.hide();
}
},
...
I don’t if it’s right there, or the code have to be in other place.
Thinks in advance.
Okay,. I could solve it.
I had several orders to the preloader, leave only one (the largest request) and it worked.
The others json request they do not have preloaders.
Question: When you want to use several app.preloader.show (); you have to modify something?. Because otherwise it seems that they are replaced and take only one.
Thanks.