I'm trying to save colvis state with added custom css of active sate to a button.

I'm trying to save colvis state with added custom css of active sate to a button.

man_ivanauskasman_ivanauskas Posts: 1Questions: 1Answers: 0
edited April 2022 in Free community support
  1. Test case something like that - http://live.datatables.net/rojujubo/2/edit. The Idea is, that after refreshing the page, End user would be able to see his last choice of what section to see.
  2. The catch is herem that, I'm, trying to add custom css after visibility button is pressed.

~~~~~~
,{
extend: 'colvisGroup',
text: 'Section-one',
action: function (e, dt, node, config) {
$(".dt-buttons").find(".btn-selected-view").removeClass("btn-selected-view");
node.addClass("btn-selected-view");

                        $.fn.dataTable.ext.buttons.colvisGroup.action.call(this, e, dt, node, config);
                    },

                    show: [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 50, 55, 63, 65, 67, 68, 69],
                    hide: [3, 47, 48, 49, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 64, 66]
                },

~~~~~~~~

  1. Tried using Table.state.save but no luck.

The final question - Is there a way to save button pressed state, with added custom css?

Sign In or Register to comment.