Allow selected state on data table rows to be set programmatically
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 63
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 15
Description
### Summary
Provide a way for the selected state on data tables to be set programmatically to allow it to be externally controlled.
### 💬 Description
Currently, when using the `rowSelection` prop on a data table, the developer can determine the selected state (using `icSelectAllRows` and `icSelectedRowChange`) but there is no way to actually _set_ the selected state.
### 💰 Use value
Allows more flexibility and control for developers.
### Additional info
Need to consider how this works with pagination; I feel like this ticket should be completed after #3624 has been done (if not, make sure the problem in the comment on that ticket gets resolved). This ticket should also be completed after #3704 to reduce duplication
Because what if the prop mentioned in that ticket has not been set, but the developer tries to select a row that isn't visible? Also if the prop has been set i.e. selecting non-visible rows is allowed, it might be useful to use the logic from that ticket, and it would prevent conflicts with the current behaviour when all rows become deselected when you change pages.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issues #3624 and #3704, then inspect the data table's rowSelection behavior and its pagination interactions. Define how externally set selection should work for visible and non-visible rows, including page changes; the feature is done when the selected state can be controlled programmatically without conflicting with the existing selection callbacks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100