Hi Bernd,
Thanks for contacting Syncfusion support.
We have analyzed your query and we are able to reproduce the reported issue. We have confirmed that the issue “Script error throws when clearFiltering without filtering the columns” is a defect, and we have logged a defect report. The fix for this issue will be included in our Volume 3 SP2, 2017 release expected to be out by the month of September, 2017.
Until then we suggest you to use the below workaround solution which helps to solve this issue.
Refer the code example
...
<button id="btn" onclick="myFunc()">Clear filter</button>
<div id="Grid"></div>
...
<script type="text/javascript">
$(function () {
$("#Grid").ejGrid({
dataSource: window.gridData,
...
allowFiltering: true,
filterSettings:{filterType:"excel"},
columns: [
...
});
});
</script>
<script>
function myFunc(){
var grid = $('#Grid').ejGrid("instance");
if (grid.filterColumnCollection.length) { //check the condition if the column is filtered before calling clearFiltering method
grid.clearFiltering(grid.filterColumnCollection[0].field);
}
}
</script> |
We have prepared a simple sample link in JSPlayground that can be available under the below link.
Regards,
Manisankar Durai.