Skip to content

[EuiBasicTable] Option to make selected table items controlled from a parent component #6184

@xcrzx

Description

@xcrzx

Related issues: elastic/kibana#136616

Summary

Currently, EuiBasicTable doesn't support the table selection to be controlled from a parent component. That means if there's a global state that keeps track of selected table rows, all changes to that global state and the local EUI table state should be synchronized manually using the imperative setSelection() API. That makes state synchronization logic pretty complicated and error-prone. For example, here's how the selection state gets synchronized in Security Solution.

It would be nice to have an option to fully control selected table rows from the outside in a declarative way. Something like:

<EuiBasicTable
  selection={{
    selected: selectedItems
  }}
/>

Metadata

Metadata

Assignees

Labels

help wantedThe EUI team is unlikely prioritize. (Don't delete - used for automation)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions