beforeSelectionSet
描述
在选中单元格之前触发
用法
beforeSelectionSet: (cell: string) => void | boolean;
参数
事件的回调函数接受以下参数:
cell- (必填)单元格的 id(可为多个)
返回值
返回 true 以选中单元格,返回 false 以阻止选中单元格
示例
const spreadsheet = new dhx.Spreadsheet("spreadsheet", {});
spreadsheet.parse(data);
// 订阅 "beforeSelectionSet" 事件
spreadsheet.events.on("beforeSelectionSet", function(cell){
console.log("Cells "+spreadsheet.selection.getSelectedCell()+" will be selected");
console.log(cell);
return true;
});
相关文章: 事件处理