Browse Source

feat: 新增 sheetDeleteBefore sheetDeleteAfter 钩子

master
cdswyda 4 years ago
parent
commit
55668a72c2
  1. 4
      docs/zh/guide/config.md
  2. 10
      src/controllers/sheetmanage.js

4
docs/zh/guide/config.md

@ -1348,7 +1348,7 @@ Luckysheet开放了更细致的自定义配置选项,分别有
------------
### sheetDeleteBefore
(TODO)
- 类型:Function
- 默认值:null
- 作用:sheet删除前
@ -1357,7 +1357,7 @@ Luckysheet开放了更细致的自定义配置选项,分别有
------------
### sheetDeleteAfter
(TODO)
- 类型:Function
- 默认值:null
- 作用:sheet删除后

10
src/controllers/sheetmanage.js

@ -586,6 +586,14 @@ const sheetmanage = {
}
let arrIndex = _this.getSheetIndex(index);
const file = Store.luckysheetfile[currentIdx];
// 钩子 sheetDeleteBefore
if(!method.createHookFunction('sheetDeleteBefore', { sheet: file })){
return;
}
_this.setSheetHide(index);
$("#luckysheet-sheets-item" + index).remove();
@ -600,6 +608,8 @@ const sheetmanage = {
removedsheet[0].type = "deleteSheet";
Store.jfredo.push(removedsheet[0]);
}
// 钩子 sheetDeleteAfter
method.createHookFunction('sheetDeleteAfter', { sheet: file });
},
nulldata: null,
getGridData: function(d) {

Loading…
Cancel
Save