Skip to content

Commit

Permalink
docs: add getDrawRange method
Browse files Browse the repository at this point in the history
  • Loading branch information
fangsmile committed Dec 19, 2023
1 parent 2813b62 commit 14f3447
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
25 changes: 24 additions & 1 deletion docs/assets/api/en/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,32 @@ Unlisten to VChart chart events

Set the table data interface, which can be called as an update interface.

## getDrawRange(Function)
Get the boundRect value of the actual drawn content area of the table
like
```
{
"bounds": {
"x1": 1,
"y1": 1,
"x2": 1581,
"y2": 361
},
bottom: 361,
height: 360,
left: 1,
right: 1581,
top: 1,
width: 1580
}
```
## selectCell(Function)

Select a cell. If empty is passed, the currently selected highlight state will be cleared.

## selectCell(Function)

Select a cell
Select a cell。If empty is passed, the currently selected highlight state will be cleared.

```
/**
Expand Down
21 changes: 20 additions & 1 deletion docs/assets/api/zh/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,28 @@ tableInstance.renderWithRecreateCells();

设置表格数据接口,可作为更新接口调用。

## getDrawRange(Function)
获取表格实际绘制内容区域的boundRect的值
```
{
"bounds": {
"x1": 1,
"y1": 1,
"x2": 1581,
"y2": 361
},
bottom: 361,
height: 360,
left: 1,
right: 1581,
top: 1,
width: 1580
}
```
## selectCell(Function)

选中某个单元格
选中某个单元格。如果传空,则清除当前选中高亮状态。

```
/**
Expand Down
4 changes: 4 additions & 0 deletions docs/assets/guide/en/interaction/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Call the interface selectCells, the usage is as follows:
// Two ranges in the table: from column 1, row 2 to column 4, row 2 and from column 3, row 5 to column 7, row 8
tableInstance.selectCells([{start:{col:1,row:2},end:{col:4,row:2}},{start:{col:3,row:5},end:{col:7 ,row:8}}]);
```

### Clear current selection
When the selectCell interface is called, it can be cleared by passing null, and a special interface clearSelectedCell will be added later.

## Select style

When one or more cells are selected, VTable applies specific styles to enable the user to identify the selected cells. can be passed `theme.selectionStyle` Configure the selected style.
Expand Down
4 changes: 4 additions & 0 deletions docs/assets/guide/zh/interaction/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ tableInstance.selectCell(4,5);
// 表格中的两个范围:从列1行2到列4行2 从列3行5到列7行8
tableInstance.selectCells([{start:{col:1,row:2},end:{col:4,row:2}},{start:{col:3,row:5},end:{col:7,row:8}}]);
```

### 清除当前选中
selectCell接口调用时传空可以清除,后面增加专门的接口clearSelectedCell。

## 选中样式

当选中一个或多个单元格时,VTable 会应用特定的样式,使用户能够识别出选中的单元格。可以通过 `theme.selectionStyle` 配置选中样式。
Expand Down

0 comments on commit 14f3447

Please sign in to comment.