Search code examples
kendo-uikendo-mobile

How to reset filter programmatically on listview for Kendo Mobile?


I have configured a listview to enable filtering. In another event, how can I reset the filter?

This is what I have:

  $("#listview").kendoMobileListView({
        dataSource: dataSource,
        template: $("#listview-template").text(),
        filterable: {
            field: "ProductName",
            operator: "startswith"
        }
    });

In another function, how can I reset the filter so the listview shows all again (in case someone typed a search)?

$("#listview").data("kendoMobileListView")...??

Solution

  • Do:

    $("#listview").data("kendoMobileListView").dataSource.filter({});