This is a migrated thread and some comments may be shown as answers.

Best practice to use app.showLoading(), app.hideLoading() before App is ready and during view transitions

2 Answers 295 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Adrian
Top achievements
Rank 1
Adrian asked on 16 Oct 2013, 02:21 PM
Hi,

If i run the code below, the error is
Error: The mobile application instance is not fully instantiated. Please consider activating loading in the application init event handler.
var app=new kendo.mobile.Application($(document.body), {
 skin: "flat",
 init: function() {
            console.log("Kendo UI Mobile application is ready");
        }
});
app.showLoading();
    setTimeout(function() {
        app.hideLoading();
    }, 10000);

And if i do it like this below, it will work.
var app=new kendo.mobile.Application($(document.body), {
 skin: "flat",
 init: function() {
            console.log("Kendo UI Mobile application is ready");
            app.showLoading();
    setTimeout(function() {
        app.hideLoading();
    }, 10000);
        }
});
So don't understand how to use app.showLoading for init and during views.
Can you advise what is the best practice to use the app.showLoading(),     app.hideLoading();
  1. When my phonegap/html page first loads while the mobile page is loading and populating data into datasource to be bind to listview. So I would prefer the user to see the loading icon instead of a blank screen/page.
  2. During transition from a 1st view to 2nd view before the data appears in the listview of the 2nd view.
Thanks.

2 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 18 Oct 2013, 12:58 PM
Hello Teo,

Please take a look at this (relatively old) thread, which describes an approach for the initial application loading.

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Adrian
Top achievements
Rank 1
answered on 21 Oct 2013, 02:41 PM
It a good example on how to show a splashscreen before the App is ready.
Thanks.
Tags
General Discussions
Asked by
Adrian
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Adrian
Top achievements
Rank 1
Share this question
or