Skip to main content

beforeSort

fires before a column is sorted by clicking on its header

beforeSort: (col: ICol, dir: Dirs) => void | boolean;

Parameters:

  • col: 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", (col, dir) => {    console.log("beforeSort", col, dir);    // return false;});

Change log:

added in v7.1