wave
wave copied to clipboard
Allow for dynamic column control in ui.table
Similarly, to how a table multi select can be invoked dynamically for an existing table by table.multiple=True
it would be great if we were able to dynamically hide (maybe even add) columns, something like table.columns[-1].visible=False
Motivation : When we have experiments table in HT, there are some actions to be done for single row (like rename experiment), which are done using action column in the table, and some actions that are invoked by button and allow multi select (like delete multiple experiments).
When invoking multi select, we would like to hide the the action table column, this can be done by manually recreating the table again without the action column, however, all filters/sorts previously done on the table are lost.
If it was possible, it would be great to have the ability dynamically to hide some columns of current filtered/sorted table
Hey @MartinBarus, thanks for suggesting this feature!
What about allowing filter and sort parameters to be set when creating the table? Maybe this could solve your issue and be used in other scenarios too.
I know it's easier for you to just set table.columns[-1].visible=False
but from a performance point of view the component will be recreated either way behind the scenes, right @mturoci?
from a performance point of view the component will be recreated either way
Not necessarily, if hidden, the col cells can still remain in the DOM and only CSS repaint would be needed. Not sure if Fluent provides such a feature though.
@aalencar allowing filter and sort parameters could also solve it, but we would have to be able to take updated filters from an existing table, something like new_table = ui.table(..., filters=old_table.filters, sort_filters=old_table.sort_filters)
or something similar