On my igx-grid, how do I filter one of the columns by default to only values which are true? I see there's an IgxBooleanFilteringOperand class but I can't figure out how to use it. My grid column is defined like so:
<igx-column field="active" header="Active" [editable]="true" [dataType]="'boolean'"></igx-column>
Thank you!
Hello Scott,
There are two ways you can achieve that:
1. Use the grid filter method.
This is the simples and fastest Pass your column with the filter term and the condition. In your case that would be:
this.grid.filter('active', null, IgxBooleanFilteringOperand.instance().condition('true'));
2. Build a filtering expression tree and pass it to the grid. This is a bit more complicated but you can apply multiple filters and filtering logic at once.
If the column dataType is set correctly in the filtering dropdown should be listed all Boolean related operands:
As I see from the provided code snippet, you should use '' for the Boolean value ([dataType]="'boolean'")
Sample