Browse Source

docs(config): update

1.hook:onTogglePager / scroll 2.config: pager 3.api:refreshFormula
master
dushusir 5 years ago
parent
commit
7d7c7cffc2
  1. 8
      docs/guide/api.md
  2. 28
      docs/guide/config.md
  3. 10
      docs/zh/guide/api.md
  4. 41
      docs/zh/guide/config.md
  5. 12
      src/index.html

8
docs/guide/api.md

@ -2560,17 +2560,13 @@ Use note:
### refreshFormula([setting])
[todo]
- **Parameter**
- {PlainObject} [setting]: optional parameters
+ {Object | String} [range]: Set the target selection range of the parameter. The supported selection format is `"A1:B2"`, `"sheetName!A1:B2"` or `{row:[0,1], column:[0,1]}`, allows an array of multiple selections; the default is the current selection ;The default is the entire current worksheet
+ {Function} [success]: callback function for the end of the operation
- {Function} [success]: callback function for the end of the operation
- **Explanation**
Force refresh formula. When you directly modify the values of multiple cells without triggering a refresh, and these cells are associated with formulas, you can use this API to force a formula refresh to be triggered at the end. It is generally recommended to specify the affected cell range to prevent For performance issues, if you can't determine it, leave it blank to keep the entire worksheet traversed and refreshed.
Force refresh formula. When you directly modify the values of multiple cells without triggering a refresh, and these cells are associated with formulas, you can use this API to force a formula refresh to be triggered at the end.
------------

28
docs/guide/config.md

@ -73,6 +73,7 @@ The following are all supported setting parameters
- The height of the column header area [columnHeaderHeight](#columnHeaderHeight)
- Whether to show the formula bar [sheetFormulaBar](#sheetFormulaBar)
- Initialize the default font size [defaultFontSize](#defaultFontSize)
- Pager [pager](#pager)
### container
- Type: String
@ -567,6 +568,21 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
------------
### pager
- Type:Object
- Default:null
- Usage:Pager button settings, the first version of the solution is directly used jquery plug-in [sPage](https://github.com/jvbei/sPage)
Clicking the paging button will trigger the hook function `onTogglePager`, which returns the current page number, which is the same as the `backFun` method of `sPage`. This pager setting is only responsible for the UI part. For the specific data request and data rendering after switching paging, please enter the `onTogglePager` custom processing in the number of hook lines.
```js
pager: {
pageIndex: 1, //Current page number
pageSize: 10, //How many rows of data are displayed on each page
total: 50, //Total number of rows of data
selectOption: [10, 20] //Options that allow setting the number of rows per page
}
```
------------
## Hook Function (TODO)
@ -1251,4 +1267,16 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- Default: null
- Usage: Customized method of drilling down cell data, note that this hook function is mounted under options: `options.fireMousedown`
------------
## Pager
### onTogglePager
- Type: Function
- Default: null
- Usage: Click the page button to call back the function, return the current page number, refer to [sPage backFun](https://github.com/jvbei/sPage)
- Parameter:
- {Object} [page]: Return the current page object
------------

10
docs/zh/guide/api.md

@ -2474,19 +2474,15 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
### refreshFormula([setting])
[todo]
### refreshFormula([success])
- **参数**
- {PlainObject} [setting]: 可选参数
+ {Object | String} [range]: 选区范围,支持选区的格式为`"A1:B2"`、`"sheetName!A1:B2"`或者`{row:[0,1],column:[0,1]}`,只能为单个选区;默认为整个当前工作表
+ {Function} [success]: 操作结束的回调函数
- {Function} [success]: 操作结束的回调函数
- **说明**
强制刷新公式。当你直接修改了多个单元格的值,且没有触发刷新,且这些单元格跟公式相关联,则可以使用这个api最后强制触发一次公式刷新,一般是建议指定受影响的单元格范围便于防止性能问题,如果无法确定,则留空保持整个工作表遍历刷新
强制刷新公式。当你直接修改了多个单元格的值,且没有触发刷新,且这些单元格跟公式相关联,则可以使用这个api最后强制触发一次公式刷新。
------------

41
docs/zh/guide/config.md

@ -76,6 +76,7 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 初始化默认字体大小 [defaultFontSize](#defaultFontSize)
- 是否限制工作表名长度 [limitSheetNameLength](#limitSheetNameLength)
- 默认允许工作表名的最大长度 [defaultSheetNameMaxLength](#defaultSheetNameMaxLength)
- 分页器 [pager](#pager)
### container
- 类型:String
@ -661,6 +662,22 @@ Luckysheet开放了更细致的自定义配置选项,分别有
------------
### pager
- 类型:Object
- 默认值:null
- 作用:分页器按钮设置,初版方案是直接使用的jquery插件 [sPage](https://github.com/jvbei/sPage)
点击分页按钮会触发钩子函数 `onTogglePager`,返回当前页码,同`sPage`的`backFun`方法,此分页器设置只负责UI部分,具体切换分页后的数据请求和数据渲染,请在`onTogglePager`钩子行数里自定义处理。
```js
pager: {
pageIndex: 1, //当前的页码
pageSize: 10, //每页显示多少行数据
total: 50, //数据总行数
selectOption: [10, 20] //允许设置每页行数的选项
}
```
------------
## 钩子函数
钩子函数应用于二次开发时,会在各个常用鼠标或者键盘操作时植入钩子,调用开发者传入的函数,起到扩展Luckysheet功能的作用。
@ -932,6 +949,18 @@ Luckysheet开放了更细致的自定义配置选项,分别有
+ {Boolean} [hyperlinkClick]:点击超链接
- {Object} [ctx]: 当前画布的context
------------
### scroll
- 类型:Function
- 默认值:null
- 作用:鼠标滚动事件
- 参数:{, , }
- {Object} [position]:
+ {Number} [scrollLeft]:横向滚动条的位置
+ {Number} [scrollTop]:垂直滚动条的位置
+ {Number} [canvasHeight]:canvas高度
------------
## 选区操作(包括单元格)
@ -1519,4 +1548,16 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 默认值:null
- 作用:单元格数据下钻自定义方法,注意此钩子函数是挂载在options下:`options.fireMousedown`
------------
## 分页器
### onTogglePager
- 类型:Function
- 默认值:null
- 作用:点击分页按钮回调函数,返回当前页码,具体参数参照[sPage backFun](https://github.com/jvbei/sPage)
- 参数:
- {Object} [page]: 返回当前分页对象
------------

12
src/index.html

@ -76,12 +76,12 @@
options = {
container: 'luckysheet',
lang: lang,
pager: {
pageIndex: 1,
pageSize: 10,
total: 50,
selectOption: [10, 20]
},
// pager: {
// pageIndex: 1,
// pageSize: 10,
// total: 50,
// selectOption: [10, 20]
// },
forceCalculation:false,
plugins: ['chart'],
fontList:[

Loading…
Cancel
Save