Skip to content

Commit 05fd8c7

Browse files
authored
docs: update row selection docs to reflect new handler methods (TanStack#3906)
1 parent 158b810 commit 05fd8c7

File tree

1 file changed

+17
-107
lines changed

1 file changed

+17
-107
lines changed

docs/api/row-selection.md

Lines changed: 17 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -63,46 +63,21 @@ If provided, this function will be called with an `updaterFn` when `state.rowSel
6363
6464
## Table Instance API
6565
66-
### `getToggleRowSelectedHandler`
66+
### `getToggleAllRowsSelectedHandler`
6767
6868
```tsx
69-
type getToggleRowSelectedHandler = (
70-
rowId: string
71-
) => undefined | ((e: unknown) => void)
69+
getToggleAllRowsSelectedHandler: () => (event: unknown) => void
7270
```
7371
74-
Returns the props for the `<input type="checkbox" />` element in a row that will toggle row selection and provides checked/indeterminate state.
72+
Returns a handler that can be used to toggle all rows in the table.
7573
76-
### `getToggleAllRowsSelectedProps`
74+
### `getToggleAllPageRowsSelectedHandler`
7775
7876
```tsx
79-
type ToggleRowSelectedProps = {
80-
onChange?: (e: unknown) => void
81-
checked?: boolean
82-
title?: string
83-
indeterminate?: boolean
84-
}
85-
86-
getToggleAllRowsSelectedProps: <
87-
TGetter extends Getter<ToggleRowSelectedProps>
88-
>(
89-
userProps?: TGetter
90-
) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>
91-
```
92-
93-
Returns the props for the `<input type="checkbox" />` element in a column header that will toggle row selection for all rows in the table and provides checked/indeterminate state.
94-
95-
### `getToggleAllPageRowsSelectedProps`
96-
97-
```tsx
98-
getToggleAllPageRowsSelectedProps: <
99-
TGetter extends Getter<ToggleRowSelectedProps>
100-
>(
101-
userProps?: TGetter
102-
) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>
77+
getToggleAllPageRowsSelectedHandler: () => (event: unknown) => void
10378
```
10479
105-
Returns the props for the `<input type="checkbox" />` element in a column header that will toggle row selection for all rows on the current page and provides checked/indeterminate state.
80+
Returns a handler that can be used to toggle all rows on the current page.
10681
10782
### `setRowSelection`
10883
@@ -120,54 +95,6 @@ resetRowSelection: () => void
12095
12196
Resets the **rowSelection** state for the table back to its initial state.
12297
123-
### `toggleRowSelected`
124-
125-
```tsx
126-
toggleRowSelected: (rowId: string, value?: boolean) => void
127-
```
128-
129-
Selects/deselects a row.
130-
131-
### `getRowCanSelect`
132-
133-
```tsx
134-
getRowCanSelect: (rowId: string) => boolean
135-
```
136-
137-
Returns whether or not a row can be selected.
138-
139-
### `getRowCanSelectSubRows`
140-
141-
```tsx
142-
getRowCanSelectSubRows: (rowId: string) => boolean
143-
```
144-
145-
Returns whether or not a row's sub-rows can be automatically selected when the parent row is selected.
146-
147-
### `getRowCanMultiSelect`
148-
149-
```tsx
150-
getRowCanMultiSelect: (rowId: string) => boolean
151-
```
152-
153-
Returns whether or not a row can be multi-selected. TODO clarify
154-
155-
### `getRowIsSelected`
156-
157-
```tsx
158-
getRowIsSelected: (rowId: string) => boolean
159-
```
160-
161-
Returns whether or not a row is selected.
162-
163-
### `getRowIsSomeSelected`
164-
165-
```tsx
166-
getRowIsSomeSelected: (rowId: string) => boolean
167-
```
168-
169-
Returns whether or not any sub-rows of a row are selected.
170-
17198
### `getIsAllRowsSelected`
17299
173100
```tsx
@@ -200,14 +127,6 @@ getIsSomePageRowsSelected: () => boolean
200127
201128
Returns whether or not any rows on the current page are selected.
202129
203-
### `queueResetRowSelection`
204-
205-
```tsx
206-
queueResetRowSelection: () => void
207-
```
208-
209-
TODO
210-
211130
### `toggleAllRowsSelected`
212131
213132
```tsx
@@ -232,14 +151,6 @@ getPreSelectedRowModel: () => RowModel<TGenerics>
232151
233152
TODO
234153
235-
### `queueResetRowSelection`
236-
237-
```tsx
238-
queueResetRowSelection: () => void
239-
```
240-
241-
TODO
242-
243154
### `getSelectedRowModel`
244155
245156
```tsx
@@ -298,6 +209,14 @@ getCanMultiSelect: () => boolean
298209
299210
Returns whether or not the row can multi-select. TODO clarify
300211
212+
### `getCanSelectSubRows`
213+
214+
```tsx
215+
getCanSelectSubRows: () => boolean
216+
```
217+
218+
Returns whether or not the row can select sub rows automatically when the parent row is selected.
219+
301220
### `toggleSelected`
302221
303222
```tsx
@@ -306,19 +225,10 @@ toggleSelected: (value?: boolean) => void
306225
307226
Selects/deselects the row.
308227
309-
### `getToggleSelectedProps`
228+
### `getToggleSelectedHandler`
310229
311230
```tsx
312-
type ToggleRowSelectedProps = {
313-
onChange?: (e: unknown) => void
314-
checked?: boolean
315-
title?: string
316-
indeterminate?: boolean
317-
}
318-
319-
getToggleSelectedProps: <TGetter extends Getter<ToggleRowSelectedProps>>(
320-
userProps?: TGetter
321-
) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>
231+
getToggleSelectedHandler: () => (event: unknown) => void
322232
```
323233
324-
Returns the props for the `<input type="checkbox" />` element in the row that will toggle row selection and provides checked/indeterminate state.
234+
Returns a handler that can be used to toggle the row.

0 commit comments

Comments
 (0)