jbetancur / react-data-table-component

A responsive table library with built-in sorting, pagination, selection, expandable rows, and customizable styling.
https://react-data-table-component.netlify.app
Apache License 2.0
2.04k stars 411 forks source link

Feature Request: Unable to set initial selected items #1184

Open StuartMorris0 opened 10 months ago

StuartMorris0 commented 10 months ago

Feature Check list

There is currently no way to set the initial selected items for the table.

This means if you have a table that has paginationServer, and persistSelectedOnSort | persistSelectedOnPageChange. This will all function as you expect when selecting rows the values are persisted and show correctly.

However, if you close/reopen the component there is no way to pass the initial selected rows. You can only pass your onSelectedChanged callback and the selected function. The selected function only shows the check for visible rows, and therefore calls the onSelectedChanged with the visible rows as selected, rather than knowing previously selected rows exist.

musharafshaikh16 commented 8 months ago

Same issue i'm also facing!