跳到主要内容

beforeAction

描述

在操作执行之前触发

用法

beforeAction: (action: string, config: object) => void | boolean;

参数

事件的回调函数接受以下参数:

  • action - (必填)操作的名称。完整的可用操作列表请查看此处
  • config - (必填)包含操作参数的对象

返回值

返回 false 可阻止操作执行;否则返回 true

示例

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
// 配置参数
});
spreadsheet.parse(dataset);

spreadsheet.events.on("beforeAction", (actionName, config) => {
if (actionName === "sortCells") {
console.log(actionName, config);
return false;
}
});

更新日志: 在 v4.3 中新增

相关文章: