How set some rows as initially selected #2435
-
I am displaying a table with row selection in a modal. When the user clicks "Save", the selected rows are saved into the parent component state and the modal is closed. If the user later clicks on button to edit their selections in same modal, I would like to display the table with their previously selected rows from parent component state initially selected. How can I load a table with some rows initially selected? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 17 replies
-
I found my answer here. To have some rows initially selected I add their row Ids to initialState.selectedRowIds object that is passed as option to useTable(options). |
Beta Was this translation helpful? Give feedback.
-
Hey @tahv0 you can see here |
Beta Was this translation helpful? Give feedback.
-
any new URL for this topic? that URL's already broken |
Beta Was this translation helpful? Give feedback.
-
Please provide a working URL, the above URL is broken. |
Beta Was this translation helpful? Give feedback.
-
Anyone with a working example? |
Beta Was this translation helpful? Give feedback.
I found my answer here. To have some rows initially selected I add their row Ids to initialState.selectedRowIds object that is passed as option to useTable(options).