Closed dymat closed 7 years ago
Do you mean that if you select a row with the table unfiltered, then filter it in order to remove the selected row, and then change the filter again to see the row.. The row should still be selected?
If that's the case, maybe we could add a prop to check the value of something in the row instead of relying on an internal state.
So let's say you have your person with this:
{
name: 'X',
lastname: 'Y',
selected: true
}
Then we could add a new prop on the table, something like selectedRowKey
(or maybe rowKeySelected to match the other rowKeyColumn :D)
Wow! You are fast! Thanks for reply!
You got exactly my point. It would be great if you could add such a prop.
BTW: this new prop would be a good base for writing a pagination add on which keeps track of selected rows over all pages...
Thanks again! Bye, ~dymat
For the pagination, it really depends on how it's built. I have a similar component at work and the selected elements are kept in memory, it doesn't care if there's an pagination or not ;)
Hey Folks! I'm working with DataTable and a list of row-Objects on which I need to apply a filter.
Here is an example:
When I apply a filter rowsList and rerender the Table-Component I loose my some IDs in the selectedRows-List. I need to persist these selections even if a filter is applied.
So I propose to enable selectedRows as a prop which is used to have rows selected "by default".
Or is there another way I can't see?
Greeting, ~dymat