Open grelston opened 2 years ago
Thanks for writing this up. I'm fully in favor of this approach. The 'toggle' differs from the default behavior in that clicking selects and deselects a row, while the default behavior keeps the current row selected when you click multiple times. They are orthogonal options so I would just suggest that we have:
selectable_style='checkbox' | checkbox-no-header' | 'toggle' | 'default'
Is your feature request related to a problem? Please describe.
I would like to select rows using checkboxes and set the maximum number of selectable rows to be 1. These are separate options of
Tabulator.selectable
and are therefore impossible to combine.Describe the solution you'd like
Split the multiple behaviours controlled by the
selectable
parameter into separate parameters, e.g.:selectable=True
|False
selectable_style='checkbox'
|checkbox-single'
selectable_max=int
(orselectable_max_rows=int
)I can't suggest where
selectable='toggle'
might belong because I haven't yet seen what it does. Does it make sense to be able to select both'checkbox'
and'toggle'
simultaneously? If so, it would need another different parameter name, e.g.selectable_toggle=True | False
.Describe alternatives you've considered
Initially I hoped that
selectable='checkbox-single'
would combineselectable='checkbox'
andselectable=1
, but the documentation states, "Same as ‘checkbox’ but header does not alllow select/deselect all".Additional context
Background information is in my Tabulator UI selection problem Discourse post.