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:
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):
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
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