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

Spreadsheet - How to clear applied filters?

1 Answer 98 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 05 Jun 2019, 04:10 PM
We are using kendo spreadsheet with more than one sheets, wants the functionality to clear applied filters in the spreadsheet. I couldn't find any documentations for that, please helps us to fix this issue. Thanks

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 07 Jun 2019, 07:39 AM
Hello Michael,

If I can understand correctly, you have a filter set on a column that you would like to programmatically clear. If this is the case, then you could use the Spreadsheet Sheet's clearFilter() method:
<div id="spreadsheet"></div>
<script type="text/javascript" charset="utf-8">
 
    $("#spreadsheet").kendoSpreadsheet();
 
    var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
 
    var sheet = spreadsheet.activeSheet();
 
    sheet.range("A1:B2").values([
        [1, 2],
        [2, 3]
    ]).filter({
        column: 1,
        filter: new kendo.spreadsheet.ValueFilter({
            values: [2]
        })
    }); // the filter will hide the second row
 
    sheet.clearFilter(1); // the clear filter will remove the applied filter for the second column.
</script>


Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Spreadsheet
Asked by
Michael
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or