Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
feat(api add): setSheetDelete setSheetCopy setSheetHide setSheetShow …
Browse files Browse the repository at this point in the history
…setSheetName setSheetColor
  • Loading branch information
wpxp123456 committed Sep 29, 2020
1 parent d8b76ce commit 62f641f
Show file tree
Hide file tree
Showing 4 changed files with 312 additions and 34 deletions.
22 changes: 1 addition & 21 deletions docs/zh/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1738,9 +1738,6 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开

### setSheetDelete([setting])

[todo]


- **参数**

- {PlainObject} [setting]: 可选参数
Expand All @@ -1760,9 +1757,6 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开

### setSheetCopy([setting])

[todo]


- **参数**

- {PlainObject} [setting]: 可选参数
Expand All @@ -1783,9 +1777,6 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开

### setSheetHide([setting])

[todo]


- **参数**

- {PlainObject} [setting]: 可选参数
Expand All @@ -1799,17 +1790,14 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
- **示例**:

- 隐藏当前工作表
`luckysheet.setSheetHide(true)`
`luckysheet.setSheetHide()`
- 隐藏第三个工作表
`luckysheet.setSheetHide({order:2})`

------------

### setSheetShow([setting])

[todo]


- **参数**

- {PlainObject} [setting]: 可选参数
Expand All @@ -1829,9 +1817,6 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开

### setSheetActive(order [,setting])

[todo]


- **参数**

- {Number} [order]: 要激活的工作表下标
Expand All @@ -1851,9 +1836,6 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开

### setSheetName(name [,setting])

[todo]


- **参数**

- {String} [name]: 新的工作表名称
Expand All @@ -1874,8 +1856,6 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开

### setSheetColor(color [,setting])

[todo]

- **参数**

- {String} [color]: 工作表颜色
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/sheetmanage.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ const sheetmanage = {
let copyobject = $("#luckysheet-sheets-item" + copyindex);
$("#luckysheet-sheet-container-c").append(replaceHtml(sheetHTML, { "index": copyjson.index, "active": "", "name": copyjson.name, "order": copyjson.order, "style": "", "colorset": colorset }));
$("#luckysheet-sheets-item" + copyjson.index).insertAfter(copyobject);
Store.luckysheetfile.splice(copyindex + 1, 0, copyjson);
Store.luckysheetfile.splice(copyarrindex + 1, 0, copyjson);

$("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active");
$("#luckysheet-sheets-item" + index).addClass("luckysheet-sheets-item-active");
Expand Down
12 changes: 0 additions & 12 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,6 @@ luckysheet.flowdata = function () {
// Set selection highlight
luckysheet.selectHightlightShow = selectHightlightShow;

// Set the worksheet to hide
// Use the call method to change the `this` of the function to `this` of sheetmanage,
// Prevent _this error in setSheetHide
luckysheet.setSheetHide = function(index) {
return sheetmanage.setSheetHide.call(sheetmanage,index);
}

// Set the worksheet to show
luckysheet.setSheetShow = function(index) {
return sheetmanage.setSheetShow.call(sheetmanage,index);
}

// Reset parameters after destroying the table
luckysheet.destroy = method.destroy;

Expand Down
Loading

0 comments on commit 62f641f

Please sign in to comment.