• Resolved midnightroses

    (@midnightroses)


    Hi Tobias,
    Was wondering whether it is possible to specifically targeted a column for colvis function? I wish to hide a column on my table on load but if the customer wishes to see the column, they may click on the button to display the column. If this is possible how do you do so?

Viewing 1 replies (of 1 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    For this, besides using colvis to have the ability to control the visibility state, you’ll just have to initially hide the column. For that, please add this to the “Custom Commands” text field on the table’s “Edit” screen:

    "columnDefs": [ { "visible": false, "targets": [ 3, 5 ] } ]
    

    This example would initially hide columns 4 and 6 (counting starts with 0 in the code), but the columns could be made visible again by the visitor using colvis.

    Regards,
    Tobias

Viewing 1 replies (of 1 total)
  • The topic ‘Datatables Button’ is closed to new replies.