Skip to main content

beforeFilter

fires before filtering is applied

note

The event can be canceled by returning false.

Usage

beforeFilter: (
value: string | string[] | Date | Date[],
colId?: string | number
) => void | boolean;

Parameters:

The callback of the event is called with the following parameters:

  • value: string | string[] | Date | Date[] - the value by which the data will be filtered
  • colId: string | number - the ID of the column the filter is applied to

Returns:

Return false to prevent data filtering; otherwise, true.

Example

grid.events.on("beforeFilter", (value, colId) => {
console.log("The", colId, "column is filtered by", value, "value");
// return false;
});

Related sample: Grid. Events

Change log:

  • The value parameter of the callback function can be a Date object or an array of Date[] objects since v9.3
  • Added in v8.0