Skip to main content


fires before a column is sorted by clicking on its header

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


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")


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

Example"beforeSort", (column, dir) => {
console.log("beforeSort", column, dir);
// return false;

Change log:

added in v7.1