Skip to content

Commit

Permalink
docs: add one more demo for row selection (#1682)
Browse files Browse the repository at this point in the history
Co-authored-by: sheepluo <sheepluo@tencent.com>
  • Loading branch information
chaishi and sheepluo authored Dec 18, 2023
1 parent 8adb125 commit c7b7f1c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions docs/web/api/table.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,15 @@ In scenarios involving form selection or batch operations, you can directly sele

In scenarios involving form selection or batch operations, you can directly select or deselect operation objects in front of data rows.

#### Single selection
#### ExampleA: Single selection

- `selectedRowKeys` represents an array of unique identifiers for the currently selected rows and supports the non-controlled attribute `defaultSelectedRowKeys`.
- `onSelectChange` is triggered when the selected row changes.
- Setting `columns: [{ colKey: 'row-select', type: 'single' }]` can define any column as a row selection operation column.

{{ select-single }}

#### Multiple selection
#### ExampleB: Multiple selection

- `selectedRowKeys` represents an array of unique identifiers for the currently selected rows and supports the non-controlled attribute `defaultSelectedRowKeys`.
- `onSelectChange` is triggered when the selected row changes.
Expand All @@ -228,6 +228,12 @@ In scenarios involving form selection or batch operations, you can directly sele

{{ select-multiple }}

#### ExampleC: Row Selection Without Handler

A table with row selection without an action column is generally used in some brief selection scenarios, where selection is made directly by clicking on the row. you can use `rowSelectionType: 'single' | 'multiple'` to set row selection type.

{{ select-without-handler }}

### Paginated table

#### Remote data pagination
Expand Down
10 changes: 8 additions & 2 deletions docs/web/api/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ spline: data

在涉及到表单选择、或批量操作场景中,可在数据行前直接单选或多选操作对象。

#### 单选
#### 示例一:单选(Radio)

- `selectedRowKeys` 表示当前选中行的唯一标识数组,支持非受控属性 `defaultSelectedRowKeys`
- `onSelectChange` 会在选中行发生变化时触发
- 设置 `columns: [{ colKey: 'row-select', type: 'single' }]` 可以将任意列定义为行选中操作列。

{{ select-single }}

#### 多选
#### 示例二:多选(Checkbox)

- `selectedRowKeys` 表示当前选中行的唯一标识数组,支持非受控属性 `defaultSelectedRowKeys`
- `onSelectChange` 会在选中行发生变化时触发
Expand All @@ -220,6 +220,12 @@ spline: data

{{ select-multiple }}

#### 示例三:没有操作列的行选中

不带操作列的行选中表格,一般用于一些简要选择场景,通过点击行直接选中。可以通过 `rowSelectionType: 'single' | 'multiple'` 控制单选或多选。

{{ select-without-handler }}

### 可分页的表格

#### 远程数据分页
Expand Down

0 comments on commit c7b7f1c

Please sign in to comment.