How to preselect which buttons in the dt-button-collection are active?

How to preselect which buttons in the dt-button-collection are active?

mvalerievvmvalerievv Posts: 1Questions: 1Answers: 0

Hello. I have a datatable with a lot of columns. I have a colvis button which opens a modal with different buttons (clicking them shows/hides the different columns). My question is how to "preselect" the active columns (active buttons in the colvis dropdown)

This is the opened colvis dropdown and all the columns are preselected active. I just want 5 of them to be active in the beginning.

Answers

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin

    Use the columns.visible option to hide the columns you don't want by default. The ColVis list will automatically match that.

    Allan

Sign In or Register to comment.