Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(expansion/table): tip use table option getRowId if data may change #5729

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/core/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ getRowId?: (
) => string
```

This optional function is used to derive a unique ID for any given row. If not provided the rows index is used (nested rows join together with `.` using their grandparents' index eg. `index.index.index`). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity eg. a userId, taskId, database ID field, etc.
This optional function is used to derive a unique ID for any given row. If not provided the rows index is used (nested rows join together with `.` using their grandparents' index eg. `index.index.index`). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity eg. a userId, taskId, database ID field, etc. It also prevents [expansion](../../guide/expanding) glitch if table data changes.

## Table API

Expand Down
2 changes: 2 additions & 0 deletions docs/api/features/expanding.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export type ExpandedTableState = {
}
```

Tip: if the table data may change, make sure to specify the table option [`getRowId`](../core/table#getrowid) so that the expanded state depends on immutable data ID, instead of default row index.

## Row API

### `toggleExpanded`
Expand Down