Replies: 2 comments
-
|
Just to put a fine point on it, this sort of 'select all' behavior is a widely used pattern in paginated, tabular data. Gmail and the Github Notifications view are notable examples. RAC doesn't explicitly support paginated collection state, but until now, I have had no problem adapting things and filling in the gaps. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Could you handle let onSelectionChange = (selection) => {
if (selection === 'all') {
setSelectedKeys([...allKeysOnCurrentPage]);
} else {
setSelectedKeys(selection);
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the select all discussions, it seems the behavior is hardcoded to the special "all" string without the ability to customize it. If a bit more of a customized experience is desired, there is not a way to hook in to the select all behavior to tweak it. I am currently just using RAC Table and TableHeader to illustrate this.
When I include a Checkbox inside the TableHeader component, a
"selection"slot is required. When the checkbox changes, the Table'sonSelectedKeysChangehandler is called with the special "all" value that is intended to indicate that the entire dataset is selected. It is too limiting for this to be the only mode that this header checkbox enables. For example, selecting the select all Checkbox might just cause the current page of items to be selected, and have an auxiliary button appear to select the entire dataset.I'm not opposed to the current behavior being the default, but I'd like to customize it. As stated before, the "selection" slot is required, and as a result, adding
onChangeto the Combobox merges the props, causing the context'sonChangeto be called first.Perhaps there is a way to work around this, but I don't see it currently!
Beta Was this translation helpful? Give feedback.
All reactions