Skip to main content

beforeSort

fires before a column is sorted by clicking on its header

beforeSort: (column: object, dir: string) => void | boolean;

Parameters:

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

  • column: object - an object with the configuration of a column
  • dir: string - the sorting direction ("desc", "asc")

Returns:

Return false to prevent a column from being sorted; otherwise, true.

Example

grid.events.on("beforeSort", (column, dir) => {
// your logic here
// return false;
});

Change log:

added in v7.1