BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hi
When tinkering with some filtering on a grid I
observed the following.
If I use the clearFiltering Method on a column that was not filtered before it throws an error when the filterType is set to 'excel'. It works if the filterType is set to 'filter bar'. Is this a bug with the 'excel' grid?
If this is a wanted feature is there a straightforward way to find out if a filter is set for a given column? I don’t think it is straightforward to get all filters from *.widget.model.filterSettings.filteredColumns and run through all entries looking for the value of ‘field’.
Regards
Bernd
...
<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> |