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

Filterable listview, showing double search box on refresh or recall

2 Answers 100 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 13 Jan 2014, 07:07 AM
Hi,

Im trying to update my listview datasource with .read() .refresh() but it creates a new search box.  This also happens if I call the listview with data-show at the view.

Any ideas on how to remove the old search box?

Thanks.

<div data-role="view" data-layout="overview-layout" id="overview-current" data-show="mobileListViewFilteringCurrent" data-title="test">
     <center><h2>TESTING</h2></center>
     <ul id="filterable-listview-current"></ul>
</di>


function mobileListViewFilteringCurrent() {
$("#filterable-listview-current").kendoMobileListView({
dataSource: new kendo.data.DataSource({
transport: {
read: {
url: "http://xxx.xxx.xx/data.php?mall="+current,
dataType: "json",
data: {
q: "javascript"
}
}
},
schema: {
data: "results" 
},
group: {
field: "letter"
},
sort: {
field: "name",
dir: "desc"
}
}),
template: $("#customListViewTemplate").html(),
filterable: {
field: "name",
placeholder: "Escriba el nombre del comercio...",
ignoreCase: true ,
operator: "contains"
},
fixedHeaders: true
});

2 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 14 Jan 2014, 11:20 AM
Hi Ricardo,

You are initializing the Kendo UI ListView every time you navigate to the view and the show event is fired. This is not supported and it can be a reason for a lot of unexpected errors or misbehavior. The correct event handler to instantiate the widget in would be the respective view init event handler. And you can change it on show using the setDataSource() method. Please check the following API reference:

http://docs.kendoui.com/api/mobile/listview

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ricardo
Top achievements
Rank 1
answered on 16 Jan 2014, 08:19 AM
Hi Kiril,

Excellent, worked like a charm.

Thanks
Tags
ListView (Mobile)
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Ricardo
Top achievements
Rank 1
Share this question
or