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

Loading Amination

3 Answers 448 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 09 Mar 2012, 12:55 PM
Is there a way to show / hide the Loading-Animation by Javascript Code?

And by the way, if I load remote-data by the init-Function of a listview, the loading-Animation does not come up.
Here my code:

function mobileListViewTemplatesInit() {
        $("#termin-listview").kendoMobileListView({
            dataSource: kendo.data.DataSource.create({ transport: { read: { url: urlTermine, dataType: "json",
            data: {
                gn: id
            }} }, group: "Datum" }),
            template: $("#customListViewTemplate").html(),
            headerTemplate: "<h2 class='termin-title'>Termine am ${value}</h2>"
        });
    }


3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 12 Mar 2012, 11:35 AM
Hello Thomas,

 
You can use showLoading() or hideLoading() methods of the Kendo Application to show or hide the loading animation:

<script>
   var app = new kendo.mobile.Application();
</script>
...
<script>
   app.showLoading();
   app.hideLoading();
</script>
We will document these methods for the upcomming release.

As to the second question, the mobile ListView currently does not show loading message on any remote operations. We fix this for the next release. As a workaround you can wire "requestStart" and "change" events of the DataSource and show/hide the loading message.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
d2uX
Top achievements
Rank 1
answered on 17 Jul 2012, 07:47 AM
I tried the exact same thing with
var app = new kendo.mobile.Application($(document.body), {
    transition: 'slide',
});

but whenever I'm trying to call app.showLoading() or app.hideLoading() I receive an
Uncaught TypeError: Cannot call method 'showLoading' of undefined
//edit: app wasn't initialized when being called. $(function(){};) fixed it.
0
emidio rana
Top achievements
Rank 1
answered on 30 Apr 2013, 02:36 PM
If I use:
var app = new kendo.mobile.Application($(document.body), {
    transition: 'slide',
});

and then I managing loading in this way in a listview:

   requestStart: function(e) {
                        app.showLoading();
                  },
                change: function(e) {
                       app.hideLoading();
                  },
The page stopped to work. If I get way:   transition: 'slide',
The page working. So there is a fix for it?
Tags
General Discussions
Asked by
Thomas
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
d2uX
Top achievements
Rank 1
emidio rana
Top achievements
Rank 1
Share this question
or