Custom Filter
Demo
Description
How to use Custom Filter?
// define you columns, in this demo Effort Driven will use a Select Filter const columnDefinitions = [ { id: 'title', name: 'Title', field: 'title' }, { id: 'description', name: 'Description', field: 'description', filterable: true, filter: { model: CustomInputFilter // create a new instance to make each Filter independent from each other } } ]; // you also need to enable the filters in the Grid Options const gridOptions = { enableFiltering: true };export class MyCustomFilter implements Filter { private $filterElm: any; grid: any; searchTerms: SearchTerm[]; columnDef: Column; callback: FilterCallback; operator: OperatorType | OperatorString = OperatorType.equal; init(args: FilterArguments) { // ...logic } clear(triggerFilterKeyup = true) { // ...logic } destroy() { // ...logic }// define you columns, in this demo Effort Driven will use a Select Filter const columnDefinitions = [ { id: 'title', name: 'Title', field: 'title' }, { id: 'description', name: 'Description', field: 'description', filterable: true, filter: { type: 'my-custom-filter' } } ]; // you also need to enable the filters in the Grid Options const gridOptions = { enableFiltering: true };
Default Filter Type
Default Search Term(s)
Collection
How to add Translation?
Custom Structure with Translation
Last updated