Skip to main content

beforeCheck

fires before the state of an item is changed

beforeCheck: (index: number, id: Id) => boolean | void;

Parameters:

  • index: number - the position of an item
  • id: string | number - the id of the item

Returns:

Return false to block changing of the state of a tree item; otherwise, true.

Example

tree.events.on("beforeCheck", function (index, id) {    console.log("beforeCheck", index, id);    // return false;});

Change log:

added in v7.1