You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EuiInMemoryTable - Allow selection to place components to the left of search input #443
I am trying to enable searching and selection on the same EuiInMemoryTable. I would like a delete button to be visible only when there are selected items. I would like the delete button to be placed to the left of the search input. Below is a mock screen of what I am trying to do.
selection needs to have a new property, PropTypes.node, that allows consumers to define what to display when items are selected. Then EuiInMemoryTable can display that node in the EuiFlexGroup that contains the search input.
yea.. we can add that. originally the search bar was not supposed to be part of the table, but since we moved to a different model (all in-memory one) then all the functionality is encapsulated within the EuiInMemoryTable which kinda forced us to put the search bar in it... we now need to accommodate adding these selection actions.
I'd go about it by adding tools under the selection prop... @snide do you want to keep it generic nodes or should we enforce some UI/UX guidelines (e.g. don't put more than one button).
I think I'll just do it exactly as the row items - you can either configure a default action or a custom one (which can effectively be anything)... keeps it consistent.
@snide what do we do when the search is not configured (so no search bar)? Should we support selection actions? it won't work well as without search and when there's no selection, there's nothing to show in the "toolbar"... but then when selection is show and we'll show the selection actions the table will "jump" down.
I'd suggest that we only support selection actions when search is set... effectively we have a toolbar with a search bar and if selection is on we show the selection actions on that toolbar.
I think the toolbar should be able to work without search. The toolbar, which is just a FlexGroup, can have the following states
No search, selection, no selected items - toolbar would be empty.
No search, selection, selected items - toolbar would be FlexGroup with single FlexItem containing the selection action node.
search, selection, no selected items - toolbar would be FlexGroup with single FlexItem containing the search input(s).
search, selection, selected items - toolbar would be FlexGroup with FlexItem containing the selection action node, and a FlexItem containing the search inputs.
sure.. that's indeed all the possible options :)... but from UI/UX perspective I believe we should avoid making the UI "jump". When you have an empty toolbox it'll automatically collapse (otherwise there's be a strange gap above the table). Then when you show the selection actions, the table will "jump" down to accommodate the toolbar. We should avoid such things. A better solution would be to put the selection action somewhere else on the page that will not cause any component to "jump"...
but I leave it to @snide to figure out the design here :)
I think anytime you have a list, you probably want search. If there's a possibility to have it without search, then I think it's fine for it to "jump". It's probably a pretty limited use case.
Activity
uboness commentedon Feb 23, 2018
yea.. we can add that. originally the search bar was not supposed to be part of the table, but since we moved to a different model (all in-memory one) then all the functionality is encapsulated within the
EuiInMemoryTablewhich kinda forced us to put the search bar in it... we now need to accommodate adding these selection actions.I'd go about it by adding
toolsunder theselectionprop... @snide do you want to keep it generic nodes or should we enforce some UI/UX guidelines (e.g. don't put more than one button).snide commentedon Feb 23, 2018
@uboness I think it's OK to make it a generic node (you might want one for the right side as well). We can cover usage through guidelines.
uboness commentedon Feb 23, 2018
I think I'll just do it exactly as the row items - you can either configure a default action or a custom one (which can effectively be anything)... keeps it consistent.
uboness commentedon Feb 23, 2018
@snide what do we do when the search is not configured (so no search bar)? Should we support selection actions? it won't work well as without search and when there's no selection, there's nothing to show in the "toolbar"... but then when selection is show and we'll show the selection actions the table will "jump" down.
I'd suggest that we only support selection actions when search is set... effectively we have a toolbar with a search bar and if selection is on we show the selection actions on that toolbar.
nreese commentedon Feb 23, 2018
I think the toolbar should be able to work without search. The toolbar, which is just a FlexGroup, can have the following states
No search, selection, no selected items - toolbar would be empty.
No search, selection, selected items - toolbar would be FlexGroup with single FlexItem containing the selection action node.
search, selection, no selected items - toolbar would be FlexGroup with single FlexItem containing the search input(s).
search, selection, selected items - toolbar would be FlexGroup with FlexItem containing the selection action node, and a FlexItem containing the search inputs.
uboness commentedon Feb 23, 2018
sure.. that's indeed all the possible options :)... but from UI/UX perspective I believe we should avoid making the UI "jump". When you have an empty toolbox it'll automatically collapse (otherwise there's be a strange gap above the table). Then when you show the selection actions, the table will "jump" down to accommodate the toolbar. We should avoid such things. A better solution would be to put the selection action somewhere else on the page that will not cause any component to "jump"...
but I leave it to @snide to figure out the design here :)
snide commentedon Feb 24, 2018
I think anytime you have a list, you probably want search. If there's a possibility to have it without search, then I think it's fine for it to "jump". It's probably a pretty limited use case.