Null filter issue while trying to clear Multiselect grid header filter

2 posts, 0 answers
  1. Ankit
    Ankit avatar
    2 posts
    Member since:
    Jun 2018

    Posted 23 Jun 2018 Link to this post

    Hi 

    I dont know , what i am doing wrong while trying to clear all multiselect header filters, as after clearing all columns, somehow a null filter get set on a random header column. Below is my code

    01.function clearFilter(filter,grid) {
    02.       if (filter.filters) {
    03.           for (var i = 0; i < filter.filters.length; i++) {
    04.               clearFilter(filter.filters[i],grid);
    05.           }
    06.       }
    07.       else {
    08.           grid.dataSource.filter({
    09.               field: filter.field,
    10.               operator: filter.operator,
    11.               value: ""
    12.           });
    13.       }
    14.   }


  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 26 Jun 2018 Link to this post

    Hello,

    In general the passing and empty object to the filter method of the Kendo UI DataSource should be enough for your case in order to clear the grid filter. 

    1) Go to http://demos.telerik.com/kendo-ui/grid/filter-row
    2) Apply some filters to the Grid
    3) Execute the following in the browser's JavaScript console. The Grid will rebind and all filtering inputs will be cleared.

    $("#grid").data("kendoGrid").dataSource.filter({})


    Regards,
    Boyan Dimitrov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top