Simultaneously Toggle Some Columns On & Other Columns Off?

Simultaneously Toggle Some Columns On & Other Columns Off?

TomHallTomHall Posts: 27Questions: 10Answers: 1

I would hope this would be an easy question to answer.

Say I have 12 columns, 0 - 7 are visible, 8-11 are hidden.

I have this code

               {

                    extend: 'columnToggle',

                    text: 'Update',

                    columns: [8,9,10,11]

                }

Can I show 8-11 while hiding 4,5,6,7 and toggle between visibility of those 8 columns?

Replies

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923

    See if this example does what you want.

    Kevin

  • TomHallTomHall Posts: 27Questions: 10Answers: 1

    Thank you, but it is not. In the link you sent me there are 3 buttons. I only want 1 button.

    I have 12 columns. 1 - 8 are visible. 9 - 12 are hidden.

    Click the button (only 1) and 4-8 get hidden, and 9-12 are visible.

    Click the button again, 4-8 are visible, 9-12 are hidden.

    Just one button....toggling an alternating group of buttons

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

    You could do something like the Married button in this example. In that example it's filtering, but you could use the same framework to add calls to columns().visible() for your logic,

    Colin

  • TomHallTomHall Posts: 27Questions: 10Answers: 1

    Thank you, very much appreciated.

This discussion has been closed.