Restrict to at least one visible column at all times + hide/show all
Restrict to at least one visible column at all times + hide/show all
Hey,
I'm using the extended colvis collection.
Is there any way to force at least one column to be selected at all times? i.e. If only 1 column is visible and the user tries to click it in order to hide it, it won't work. Is there any callback I can somehow make this check in, and return false when requesting to hide the only 1 visible column?
Also, similarly to colvisRestore, I need directions on how to add a hide/show all columns behavior to the top of the collection (with prefixButtons I guess), preferably in a single toggle button. Any directions?
I need to think of a way to make 'hide all' respect the at least 1 visible column at all times restriction I'm looking to implement. But I'm getting ahead of myself since I don't even know if all of this is possible.
Thanks.
Answers
Solved 1 for now:
Unfortunately the event doesn't support preventing the default, so it's kinda hacky, but it's the best I've got atm.