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

treegrid.events.on("beforeSort", (column, dir) => {
console.log("beforeSort", column, dir);
// return false;
});

Change log:

added in v7.1