Wijgrid provides built-in filtering features that do not require you to write a lot of code. To enable data filtering at runtime, set the showFilter option to true. (The default value is false.) When set to true, a filter row appears under the column header row.
To filter data at run time, click the drop-down arrow to the right of the filter box on the column that you want to filter, and select the type of filter you want to use, then enter the value against which to filter. To clear the filter, click the drop-down arrow again and select No filter.
Set filter values using the filterValue option. If you do not explicitly set a value, it uses the default value of the column's data type.
Set filter operators using the filterOperator option. The default operator is Contains, but you can also use any of the operators in the following table.
Option | Description |
---|---|
NoFilter | All rows are shown. |
Contains (default) | Rows containing the specified items in the column are shown. Data type: string |
NotContain | Rows that do not contain the specified items in the column are shown. Data type: string |
BeginsWith | Rows that contain strings beginning with the specified string in the column are shown. Data type: string |
EndsWith | Rows that contain strings ending with the specified string in the column are shown. Data type: string |
Equals | Rows containing the exact specified value in the column are shown. Data type: string, number, datetime, currency, or Boolean |
NotEqual | Rows not containing the exact specified value in the column are shown. Data type: string, number, datetime, currency, or Boolean |
Greater | Rows containing a value larger than the specified value in the column are shown. Data type: string, number, datetime, or currency. |
Less | Rows containing a value smaller than the specified value in the column are shown. Data type: string, number, datetime, or currency. |
GreaterOrEqual | Rows containing a value the same as or larger than the specified value in the column are shown. Data type: string, number, datetime, or currency. |
LessOrEqual | Rows containing a value the same as or smaller than the specified value in the column are shown. Data type: string, number, datetime, or currency. |
IsEmpty | Rows that contain no value in the column are shown. Data type: string |
NotIsEmpty | Rows that contain any value in the column are shown. Data type: string |
IsNull | Rows that contain a null value in the column are shown. Data type: string, number, datetime, currency, or Boolean |
NotIsNull | Rows that contain a value other than null in the column are shown. Data type: string, number, datetime, currency, or Boolean |
Custom | See Use Custom Filtering for more information. |
You can also localize or customize the filterType text. See Custom Grid Strings for more information.