From 4e9ea643b6cfe6dc82ac219eb4744679ef8b5914 Mon Sep 17 00:00:00 2001 From: Patrick Richardson Date: Mon, 4 Dec 2023 11:02:21 -0800 Subject: [PATCH 1/2] Improve row selection docs * Added note about row selection being index based by default * Added a tanstack link for how row selection can managed with a custom id using the `getRowId` option on the core table api. * Referenced the use case of manual pagination as it is one of the most likely scenarios that using a custom id is necessary for row selection This should help developers understand how row selection is implemented. --- docs/api/features/row-selection.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api/features/row-selection.md b/docs/api/features/row-selection.md index 6032f3803f..51e4b88728 100644 --- a/docs/api/features/row-selection.md +++ b/docs/api/features/row-selection.md @@ -15,6 +15,8 @@ export type RowSelectionTableState = { } ``` +By default, row selection uses the index of the row. Row selection state can be tracked with a unique row id by passing in a custom [getRowId](../../api/core/table.md#getrowid) function to the the table. This may be necesssary when deleting rows while using manual pagination. + ## Table Options ### `enableRowSelection` From 664ca8dbd7b77de05f26c020bcf36492d744cf69 Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Sun, 17 Dec 2023 10:43:04 -0600 Subject: [PATCH 2/2] reword --- docs/api/features/row-selection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/features/row-selection.md b/docs/api/features/row-selection.md index 51e4b88728..d8874b7048 100644 --- a/docs/api/features/row-selection.md +++ b/docs/api/features/row-selection.md @@ -15,7 +15,7 @@ export type RowSelectionTableState = { } ``` -By default, row selection uses the index of the row. Row selection state can be tracked with a unique row id by passing in a custom [getRowId](../../api/core/table.md#getrowid) function to the the table. This may be necesssary when deleting rows while using manual pagination. +By default, the row selection state uses the index of each row as the row identifiers. Row selection state can instead be tracked with a custom unique row id by passing in a custom [getRowId](../../api/core/table.md#getrowid) function to the the table. ## Table Options