-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EuiTables enable selection management from outside of component #1077
Comments
++ would be super useful |
Me too facing same scenario with EuiBasicTable, adding would be great! |
++
The documentaiton in the Adding selection to a BasicTable example at https://elastic.github.io/eui/#/display/tables makes implementing this case straightfoward (thanks!).
In scenario 1, the following example code from Adding selection to a BasicTable resets the selection state of the component that owns the table when the user clicks delete:
In use case #1, after performing IO to delete the selected items from the server, the In use case #2, we would like to clear the selection state of all selected items after performing IO (just like scenario 1). The code might look something like this:
The challenge with the code above is I’m not sure how to pass down the empty So in use case 2, when the updated data from the server is rendered in the table, the table (correctly) renders the new state of the items (they are shown as “favorites” with a ⭐), but the checkboxes remain checked, because the table does not know about this change to state:
|
A simpler case is to define initial selection for the table it could be a property in the component
or as a property similar to selectable in the selection properties
|
This issue is fixed and can be closed 👍 |
Closed by #3418 |
I'm using an EuiInMemoryTable and wanted to allow a parent component to cancel all selections in the nested table. At the moment I can replace the array I'm maintaining in the parent component and updating on the table's
onSelectionChange
prop, but I can't tell the table to deselect items via props.It would be useful to be able to tell a table to update the selected items:
We can presently allow the user to simply use the table's top selection box to deselect all items, but in some cases we may want to clear the selection automatically.
The text was updated successfully, but these errors were encountered: