Skip to main content


fires before a column is sorted by clicking on its header

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


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

Change log:

added in v7.1