diff --git a/docs/guide/api.md b/docs/guide/api.md index e3b46a6..59b02cd 100644 --- a/docs/guide/api.md +++ b/docs/guide/api.md @@ -2026,6 +2026,26 @@ Use note: ------------ +### scroll([setting]) + +[todo] + + +- **参数**: + + - {PlainObject} [setting]: optional parameters + + {Number} [scrollWidth]: horizontal scroll value. The default is the current horizontal scroll position. + + {Number} [scrollHeight]: Vertical scroll value. The default is the current vertical scroll position. + + {Number} [targetRow]: Scroll vertically to the specified row number. The default is the current vertical scroll position. + + {Number} [targetColumn]: scroll horizontally to the specified column number. The default is the current horizontal scroll position. + + {Function} [success]: The callback function after the table is refreshed successfully + +- **说明**: + + Scroll current worksheet position + +------------ + ### resize([setting]) - **Parameter**: diff --git a/docs/zh/guide/api.md b/docs/zh/guide/api.md index ee084fa..a53bd87 100644 --- a/docs/zh/guide/api.md +++ b/docs/zh/guide/api.md @@ -1973,6 +1973,26 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开 ------------ +### scroll([setting]) + +[todo] + + +- **参数**: + + - {PlainObject} [setting]: 可选参数 + + {Number} [scrollWidth]:横向滚动值。默认为当前横向滚动位置。 + + {Number} [scrollHeight]:纵向滚动值。默认为当前纵向滚动位置。 + + {Number} [targetRow]:纵向滚动到指定的行号。默认为当前纵向滚动位置。 + + {Number} [targetColumn]:横向滚动到指定的列号。默认为当前横向滚动位置。 + + {Function} [success]: 表格刷新成功后的回调函数 + +- **说明**: + + 滚动当前工作表位置 + +------------ + ### resize([setting]) - **参数**: @@ -2278,6 +2298,7 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开 按照scrollWidth, scrollHeight刷新canvas展示数据。 + > 推荐使用新API: [scroll](#scroll([setting])) ------------ ### setcellvalue(r, c, d, v) diff --git a/src/controllers/constant.js b/src/controllers/constant.js index 2ff7939..3e171a2 100644 --- a/src/controllers/constant.js +++ b/src/controllers/constant.js @@ -315,7 +315,7 @@ function rightclickHTML(){
@@ -357,12 +357,11 @@ function rightclickHTML(){