Can search panes be used to toggle visible columns?

Can search panes be used to toggle visible columns?

tadasstyrtadasstyr Posts: 11Questions: 5Answers: 0

Hi,

I have a case where I need to show many columns, lets say 30, but sometimes I want to hide some of them. Search panes look very good option for this case, because:
* I could use search to find specific columns which I want to hide or show.
* Easy functionality, just click column name in list and it and it will show/hide column.
* By clicking clear filter it should display all columns.

I'm not very experienced developer, maybe someone could make some simple example, if it is not too difficult?

Basic column visibility example shows how to show hide columns, but my problem is that I have like 30 columns and it is very difficult to find one you want to hide. (search is missing, I could use browser search function Ctrl+F, but this is not very user friendly option..)
https://datatables.net/extensions/buttons/examples/column_visibility/simple.html

Maybe someone have other idea or some working example how to toggle big amount of columns in user friendly way.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You can't use SearchPanes, as it's not designed for that. But you could create your own table perhaps, and call column().visible() to hide or to show.

    Colin

This discussion has been closed.