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

Commit

Permalink
feat(config): custom menu button config
Browse files Browse the repository at this point in the history
1. Configuration increase: (1). Hide back to top button enableAddBackTop
  • Loading branch information
mengshukeji committed Nov 3, 2020
1 parent 72afd14 commit 14eb78e
Show file tree
Hide file tree
Showing 16 changed files with 460 additions and 141 deletions.
46 changes: 35 additions & 11 deletions docs/guide/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## **<span style="font-size:20px;">Q</span>** What is the difference between data and celldata in luckysheetfile?

**<span style="font-size:20px;">A</span>**: Use one-dimensional array format [celldata](/zh/guide/sheet.html#celldata), after the initialization is completed, the data converted into a two-dimensional array format is used for storage and update, and celldata is no longer used.
**<span style="font-size:20px;">A</span>**: Use one-dimensional array format [celldata](/guide/sheet.html#celldata), after the initialization is completed, the data converted into a two-dimensional array format is used for storage and update, and celldata is no longer used.

If you need to take out `data` as initial data, you need to execute [transToCellData(data)](/guide/api.html#transtocelldata-data-setting) to convert it to celldata data.
Among them, the celldata in `{ r, c, v }` format is converted to a two-dimensional array using [transToData(celldata)](/guide/api.html#transtodata-celldata-setting)
Expand All @@ -20,7 +20,7 @@ luckysheet.transToData(celldata)

## **<span style="font-size:20px;">Q</span>** What are the cell types?

**<span style="font-size:20px;">A</span>**: Refer to [Cell Format List](/zh/guide/cell.html), with examples of available cell formats
**<span style="font-size:20px;">A</span>**: Refer to [Cell Format List](/guide/cell.html), with examples of available cell formats

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

Expand All @@ -35,13 +35,13 @@ luckysheet.transToData(celldata)

## **<span style="font-size:20px;">Q</span>** Why will the formula in the table not be triggered after initialization?

**<span style="font-size:20px;">A</span>** : Refer to [Table data format](/zh/guide/sheet.html#calcchain) ,just set the calcChain corresponding to the cell data.
**<span style="font-size:20px;">A</span>** : Refer to [Table data format](/guide/sheet.html#calcchain) ,just set the calcChain corresponding to the cell data.

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

## **<span style="font-size:20px;">Q</span>** Is the remote loading data loadUrl or updateUrl?

**<span style="font-size:20px;">A</span>**: [loadUrl](/zh/guide/config.html#loadurl). Configure loadUrl, Luckysheet will request the entire table data through ajax, and updateUrl will be used as the interface address for collaborative editing in real-time saving.
**<span style="font-size:20px;">A</span>**: [loadUrl](/guide/config.html#loadurl). Configure loadUrl, Luckysheet will request the entire table data through ajax, and updateUrl will be used as the interface address for collaborative editing in real-time saving.
Note: Initial data needs to be configured with loadUrl and loadSheetUrl parameters, while for collaborative editing, the four parameters of loadUrl, loadSheetUrl, updateUrl and allowUpdate can be configured to take effect.

------------
Expand Down Expand Up @@ -90,14 +90,14 @@ refer this article:

## **<span style="font-size:20px;">Q</span>** How to monitor cell hover or click events? how to monitor `cellRenderAfter` in real-time?

**<span style="font-size:20px;">A</span>** :我们搜集到需要针对单元格事件的二次开发需求,规划了单元格相关的钩子函数,参考[单元格钩子函数](/zh/guide/config.html#cellrenderafter)(显示的TODO的暂未开放)
**<span style="font-size:20px;">A</span>** :我们搜集到需要针对单元格事件的二次开发需求,规划了单元格相关的钩子函数,参考[单元格钩子函数](/guide/config.html#cellrenderafter)(显示的TODO的暂未开放)

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

## **<span style="font-size:20px;">Q</span>** How to customize the top toolbar?

**<span style="font-size:20px;">A</span>**
reference: [options.showtoolbarconfig](/zh/guide/config.html#showtoolbarconfig)(TODO means waiting to developed)
reference: [options.showtoolbarconfig](/guide/config.html#showtoolbarconfig)(TODO means waiting to developed)

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

Expand All @@ -113,15 +113,15 @@ if you want to remove jQuery in `Luckysheet`, you can find `jQuery` in source co

## **<span style="font-size:20px;">Q</span>** How to add a field to a cell object?

**<span style="font-size:20px;">A</span>** reference [cell object format](/zh/guide/cell.html),then read this annotation[src/controllers/postil.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/postil.js)。the annotation is a configuration in a cell object.
**<span style="font-size:20px;">A</span>** reference [cell object format](/guide/cell.html),then read this annotation[src/controllers/postil.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/postil.js)。the annotation is a configuration in a cell object.

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

## **<span style="font-size:20px;">Q</span>** The toolbar icon is on the loading stage all the time.

**<span style="font-size:20px;">A</span>** The luckysheet use iconfont icon in this project, if any icon cannot be loaded ,plz check your iconfont.css. we are so sorry that we did not describe it clearly in the old version documents.

Now the documents have been updated.[official documents](/zh/guide/#使用步骤)
Now the documents have been updated.[official documents](/guide/#steps-for-usage)

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

Expand All @@ -140,7 +140,7 @@ more information:[Luckyexcel](https://github.com/mengshukeji/Luckyexcel/)

## **<span style="font-size:20px;">Q</span>** How to disable editing of cells?How to open sheet protection?

**<span style="font-size:20px;">A</span>** Sheet protection includes disable editing of cells that you need to make some configurations on each sheets. `config.authority`, the latest configurations[sheet protection](/zh/guide/sheet.html#config-authority)
**<span style="font-size:20px;">A</span>** Sheet protection includes disable editing of cells that you need to make some configurations on each sheets. `config.authority`, the latest configurations[sheet protection](/guide/sheet.html#config-authority)

In order to make it easier for you to understand the function of sheet protection, the following video shows how to make the whole sheet uneditable, but allow a column of cells to be edited:

Expand All @@ -152,7 +152,7 @@ In you local browser, you can open the control pannel, use `luckysheet.getLuckys

## **<span style="font-size:20px;">Q</span>** How to configure data validation?

**<span style="font-size:20px;">A</span>** there is the configuration of data validation,[data validation](/zh/guide/sheet.html#dataVerification)。Also there is the API that you can use `data validation` in any time. [setDataVerification](/zh/guide/api.html#setdataverification-optionitem-setting).
**<span style="font-size:20px;">A</span>** there is the configuration of data validation,[data validation](/guide/sheet.html#dataVerification)。Also there is the API that you can use `data validation` in any time. [setDataVerification](/guide/api.html#setdataverification-optionitem-setting).

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

Expand Down Expand Up @@ -181,6 +181,30 @@ if you want to get the position of the picture, you can overlap the picture with
**<span style="font-size:20px;">A</span>** There are two ways to get it

- 1. use `luckysheet.getLuckysheetfile()` to get all configuration data, so you can get the `defaultRowHeight` and `defaultColWidth` in the sheet configuration data。
- 2. use API to get the default row height [getDefaultRowHeight](/zh/guide/api.html#getdefaultrowheight-setting) and column width.[getDefaultColWidth](/zh/guide/api.html#getdefaultcolwidth-setting)
- 2. use API to get the default row height [getDefaultRowHeight](/guide/api.html#getdefaultrowheight-setting) and column width.[getDefaultColWidth](/guide/api.html#getdefaultcolwidth-setting)

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

## **<span style="font-size:20px;">Q</span>** How to hide the add row button and the back to top button below the worksheet?

**<span style="font-size:20px;">A</span>** Configuration is open
- Allow adding rows [enableAddRow](/guide/config.html#enableaddrow)
- Allow back to top [enableAddBackTop](/guide/config.html#enableAddBackTop)

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

## **<span style="font-size:20px;">Q</span>** How to hide the row and column headings of the worksheet?

**<span style="font-size:20px;">A</span>** Configuration is open
- The width of the row header area [rowHeaderWidth](/guide/config.html#rowheaderwidth)
- The height of the column header area [columeHeaderHeight](/guide/config.html#columeheaderheight)

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

## **<span style="font-size:20px;">Q</span>** What method can be called to set `config.merge`?

**<span style="font-size:20px;">A</span>** Three methods
- Interface operation
- Use API: [setRangeMerge](/guide/api.html#setrangemerge-type-setting)
- Manually assemble merge parameters
------------
4 changes: 1 addition & 3 deletions docs/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ Use note:

Return all worksheet configurations, the format is the same as the worksheet configuration, and the results obtained can be used as options.data when the form is initialized.

Therefore, this API is suitable for manually operating and configuring a table, and then taking out all the worksheet information to save it, and then use it for table creation in other places. If you want to get all the workbook data including the workbook configuration, you can use [toJson](#toJson())
Therefore, this API is suitable for manually operating and configuring a table, and then taking out all the worksheet information to save it, and then use it for table creation in other places. If you want to get all the workbook data including the workbook configuration, it is recommended to use [toJson](#toJson()), and it can be directly used to initialize Luckysheet.

- **Usage**:

Expand Down Expand Up @@ -2568,8 +2568,6 @@ Use note:

### toJson()

[todo]

- **Explanation**

The exported json string can be directly used as the parameter `options` when the workbook is initialized by `luckysheet.create(options)`. The usage scenario is to manually save all the parameters after the user manipulates the table, and then initialize the table elsewhere. Use, similar to the import and export of a luckysheet proprietary format.
Expand Down
111 changes: 64 additions & 47 deletions docs/guide/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Luckysheet has opened more detailed custom configuration options, which are as f
- Customize the toolbar ([showtoolbarConfig](#showtoolbarConfig))
- Customize the bottom sheet bar ([showsheetbarConfig](#showsheetbarConfig))
- Customize the counting bar ([showstatisticBarConfig](#showstatisticBarConfig))
- Custom add row and back to the top ([sheetBottomConfig](#sheetBottomConfig))
- Custom cell right-click menu ([cellRightClickConfig](#cellRightClickConfig))
- Customize the right-click menu of the bottom sheet bar ([sheetRightClickConfig](#sheetRightClickConfig))

Expand Down Expand Up @@ -59,10 +58,9 @@ The following are all supported setting parameters
- Customize the bottom sheet bar [showsheetbarConfig](#showsheetbarConfig)
- The bottom count bar [showstatisticBar](#showstatisticBar)
- Custom Count Bar [showstatisticBarConfig](#showstatisticBarConfig)
- Custom add row and back to top [sheetBottomConfig](#sheetBottomConfig)
- Allow editing [allowEdit](#allowEdit)
- Allow adding rows [enableAddRow](#enableAddRow)
- Allow adding columns [enableAddCol](#enableAddCol)
- Allow back to top [enableAddBackTop](#enableAddBackTop)
- User Info [userInfo](#userInfo)
- User Information Menu [userMenuItem](#userMenuItem)
- Back button link [myFolderUrl](#myFolderUrl)
Expand All @@ -73,8 +71,8 @@ The following are all supported setting parameters
- Refresh formula [forceCalculation](#forceCalculation)
- Custom cell right-click menu [cellRightClickConfig](#cellRightClickConfig)
- Customize the right-click menu of the bottom sheet bar [sheetRightClickConfig](#sheetRightClickConfig)
- Whether to show the row number area [showRowBar](#showRowBar)
- Whether to show the column number area [showColumnBar](#showColumnBar)
- The width of the row header area [rowHeaderWidth](#rowHeaderWidth)
- The height of the column header area [columeHeaderHeight](#columeHeaderHeight)
- Whether to show the formula bar [sheetFormulaBar](#sheetFormulaBar)
- Initialize the default font size [defaultFontSize](#defaultFontSize)

Expand Down Expand Up @@ -350,21 +348,6 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
}
```
------------
### sheetBottomConfig

[todo]

- Type: Object
- Default: {}
- Usage: Add row button and back to top button configuration below the worksheet
- Format:
```json
{
addRow: false, // Add row button
backTop: false // Back to the top
}

------------
### allowEdit
- Type: Boolean
- Default: true
Expand All @@ -377,10 +360,10 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Usage: Allow additional rows

------------
### enableAddCol
### enableAddBackTop
- Type: Boolean
- Default: true
- Usage: Allow adding columns
- Usage: Allow back to top

------------
### userInfo
Expand Down Expand Up @@ -439,27 +422,61 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
------------
### cellRightClickConfig

[todo]

- Type: Object
- Default: {}
- Usage: Custom configuration cell right-click menu
- Format:
```json
- Format:
```json
{
copy: false, //Copy
copyAs: false, //Copy as
paste: false, //Paste
insert: false, //Insert
delete: false, //Delete
hide: false, //Hide
deleteCell: false, //Delete cell
clear: false, //Clear content
matrix: false, //Matrix operation selection
sort: false, //Sort selection
filter: false, //Filter selection
chart: false //Chart generation
}
copy: false, // copy
copyAs: false, // copy as
paste: false, // paste
insertRow: false, // insert row
insertColumn: false, // insert column
deleteRow: false, // delete the selected row
deleteColumn: false, // delete the selected column
deleteCell: false, // delete cell
hideRow: false, // hide the selected row and display the selected row
hideColumn: false, // hide the selected column and display the selected column
rowHeight: false, // row height
columnWidth: false, // column width
clear: false, // clear content
matrix: false, // matrix operation selection
sort: false, // sort selection
filter: false, // filter selection
chart: false, // chart generation
image: false, // insert picture
link: false, // insert link
data: false, // data verification
cellFormat: false // Set cell format
}
```

In addition to the cells, the configuration here also includes the row header right-click menu, the column header right-click menu, and the column header drop-down arrow menu. The specific configuration relationships are as follows:

|Right-click menu configuration|Cell|Row header|Column header|Column arrow|
| ------------ | ------------ | ------------ | ----------- | ------------ |
|copy|copy|copy|copy|copy|
|copyAs|copy as|copy as|copy as|copy as|
|paste|paste|paste|paste|paste|
|insertRow|Insert a row|Increase N rows upwards and N rows downwards|-|-|
|insertColumn|Insert Column|-|Add N columns to the left and N columns to the right|Add N columns to the left and N columns to the right|
|deleteRow|Delete selected row|Delete selected row|-|-|
|deleteColumn|Delete selected column|-|Delete selected column|Delete selected column|
|deleteCell|Delete cell|-|-|-|
|hideRow|Hide the selected row and show the selected row|Hide the selected row and show the selected row|-|-|
|hideColumn|Hide the selected column and show the selected column|-|Hide the selected column and show the selected column|Hide the selected column and show the selected column|
|rowHeight|-|row height|-|-|
|columnWidth|-|-|Column Width|Column Width|
|clear|clear content|clear content|clear content|-|
|matrix|Matrix Operation Selection|Matrix Operation Selection|Matrix Operation Selection|-|
|sort|Sort selection|Sort selection|Sort selection|A-Z sort and Z-A sort|
|filter|Filter selection|Filter selection|Filter selection|-|
|chart|chart generation|chart generation|chart generation|-|
|image|Insert Picture|Insert Picture|Insert Picture|-|
|link|Insert link|Insert link|Insert link|-|
|data|Data Verification|Data Verification|Data Verification|-|
|cellFormat|Set cell format|Set cell format|Set cell format|-|

------------
### sheetRightClickConfig
Expand All @@ -483,16 +500,16 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
}

------------
### showRowBar
- Type: Boolean
- Default: true
- Usage: Whether to show the row number area
### rowHeaderWidth
- Type: Number
- Default: 46
- Usage: The width of the row header area, if set to 0, it means to hide the row header

------------
### showColumnBar
- Type: Boolean
- Default: true
- Usage: Whether to show the column number area
### columeHeaderHeight
- Type: Number
- Default: 20
- Usage: The height of the column header area, if set to 0, it means hide the column header

------------
### sheetFormulaBar
Expand Down
25 changes: 25 additions & 0 deletions docs/zh/guide/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,29 @@ Luckyexcel是excel导入导出库,项目采用了gulp作为打包工具,旧
- 一是使用`luckysheet.getLuckysheetfile()`获取到所有工作表配置后,在各个工作表的配置中直接取得默认行高`defaultRowHeight`和默认列宽`defaultColWidth`
- 二是开放了API可以获取到工作表默认的行高[getDefaultRowHeight](/zh/guide/api.html#getdefaultrowheight-setting)和列宽[getDefaultColWidth](/zh/guide/api.html#getdefaultcolwidth-setting)

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

## **<span style="font-size:20px;">Q</span>** 如何隐藏工作表下方的添加行按钮和回到顶部按钮?

**<span style="font-size:20px;">A</span>** 已开放配置
- 允许添加行 [enableAddRow](/zh/guide/config.html#enableaddrow)
- 允许回到顶部 [enableAddBackTop](/zh/guide/config.html#enableAddBackTop)

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

## **<span style="font-size:20px;">Q</span>** 如何隐藏工作表的行标题和列标题?

**<span style="font-size:20px;">A</span>** 已开放配置
- 行标题区域的宽度 [rowHeaderWidth](/zh/guide/config.html#rowheaderwidth)
- 列标题区域的高度 [columeHeaderHeight](/zh/guide/config.html#columeheaderheight)

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

## **<span style="font-size:20px;">Q</span>** 调用什么方法能设置`config.merge`

**<span style="font-size:20px;">A</span>** 三个方法
- 界面操作
- 用API:[setRangeMerge](/zh/guide/api.html#setrangemerge-type-setting)
- 手动组装merge参数

------------
3 changes: 1 addition & 2 deletions docs/zh/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开

返回所有工作表配置,格式同工作表配置,得到的结果可用于表格初始化时作为options.data使用。

所以此API适用于,手动操作配置完一个表格后,将所有工作表信息取出来自行保存,再用于其他地方的表格创建。如果想得到包括工作簿配置在内的所有工作簿数据,可以使用 [toJson](#toJson())
所以此API适用于,手动操作配置完一个表格后,将所有工作表信息取出来自行保存,再用于其他地方的表格创建。如果想得到包括工作簿配置在内的所有工作簿数据,推荐使用 [toJson](#toJson()),并且可以直接用于初始化Luckysheet。

- **示例**:

Expand Down Expand Up @@ -2474,7 +2474,6 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开

### toJson()

[todo]

- **说明**

Expand Down
Loading

0 comments on commit 14eb78e

Please sign in to comment.