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

duplicate pull to refresh label

2 Answers 164 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Daniele
Top achievements
Rank 1
Daniele asked on 27 Sep 2012, 04:47 PM
Hello,
If I write:

<div data-role="view" id="offers" data-layout="general-home" data-title="Offers" data-show="filterOffers">
            <ul id="pull-to-refresh-offers"></ul>
        </div>
        <script id="productsTemplate" type="text/x-kendo-template">
            <div class="content_offers">
            <span class="title">#= NAME #</span>
            </div>
        </script>


and:

function filterOffers(e) {
     
    var scroller = e.view.scroller;
    scroller.reset();
    categoryID = parseInt(e.view.params.CategoryID);
     
    //console.log(categoryID);
     
    var getOffers = new kendo.data.DataSource({
 transport: {
 read: {
 dataType: "jsonp",
                                               
 beforeSend: function(req) {
 $("#pull-to-refresh-offers").hide();
 app.showLoading();
 },
                                               
 data: {
    action: "getOffers",
    CategoryID: categoryID
    }
 }
 },
 change: function() {
 app.showLoading();
                                               
 setTimeout(function() {
                                                          
 app.hideLoading();
 $("#pull-to-refresh-offers").show();
     }, 200);
                                               
                                               
         },
         schema: {
             data: "res"
         }
         });
     
    $("#pull-to-refresh-offers").kendoMobileListView({
               dataSource: getOffers,
               pullToRefresh: true,
               template: $("#productsTemplate").text()
          });
     
}


At the second time that I run the pull to refresh the "Pull to refresh" label is duplicate (see attached image)

2 Answers, 1 is accepted

Sort by
0
Daniele
Top achievements
Rank 1
answered on 29 Sep 2012, 09:02 AM
up
0
Alexander Valchev
Telerik team
answered on 29 Sep 2012, 01:00 PM
Hi Daniele,

I believe the problem is caused by the multiple initialization of the ListView component. Mobile widgets should be initialized only once via data-attributes or through JavaScript in the init event handler (data-init).
The same approach is used in this on line demo.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView (Mobile)
Asked by
Daniele
Top achievements
Rank 1
Answers by
Daniele
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or