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

Bug When rebuilding a ListView with headers.

1 Answer 49 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Yohann
Top achievements
Rank 1
Yohann asked on 16 Apr 2014, 11:54 PM
Hello,

I am trying to re build a list view and I'm facing a situation I cannot solve:

I first build a list view with headers:

var template = Handlebars.compile( $( '#eventListTemplate' ).html() );
 
 // detach events
 var listView = $("#list-container").data("kendoMobileListView");
 if ( typeof listView !== typeof undefined ) { listView.destroy(); };
 $("#list-container").empty();
 
 $("#list-container").kendoMobileListView({
     template : template,
     dataSource: kendo.data.DataSource.create( { data:results, group:"start" } ),
     fixedHeaders: true
 });

Then when a user click on some button, it should repopulate the list view without headers this time (the data structure is completely different as well as the template):

$("#list-container").data("kendoMobileListView").destroy();
    $("#list-container").empty();
 
    var template = Handlebars.compile( $( '#userListTemplate' ).html() );
 
    $("#list-container").kendoMobileListView({
        template : template,
        dataSource: kendo.data.DataSource.create( results ),
        fixedHeaders: false
    });

Unfortunately, the list view is repopulated with the headers and the whole thing crash as nothing is displayed (I've checked in the code source, it is appended though, but nothing is displayed) its just like if when calling the destroy method the widget wasn't completely destroyed. Why is this happening ?

Thank you very much for your help as for now I have to drop out the headers

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 17 Apr 2014, 12:08 PM
Hi Yohann,

I have tried to reproduce this issue in the following jsBin, but to no avail. Could you please take a look and let me know what I missed?

http://jsbin.com/lomog/1/edit

Regards,
Kiril Nikolov
Telerik
 
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
Yohann
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or