Column Visibility Features Not Working

Column Visibility Features Not Working

elimariaaaelimariaaa Posts: 30Questions: 11Answers: 0

Hello,

I'd like to use the following features from Column Visibility under Buttons:

But they are not working even on the documentation.

I've also seen this: http://live.datatables.net/sezigoti/5/edit

When can it be fixed? How can I fix it? The workaround stated above does not work for me. I have datatables working server-side. You can see it in action here.

I'd like to exclude "Id" and "Action" in Column Visibility button.

Any help is highly appreciated. Thanks!

-Eli

Answers

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,773

    The problem with the first example is a known issue. I tried the second example the restore option works for me. I tried the http://live.datatables.net/sezigoti/5/edit example and it seems to work for me. The Age column was set to:

          {
            name: 'Age',
            visible: false,
            className: 'notToggleVis'
          },
    

    I removed the visible: false, to see the column and it was not in the list of colvis columns. Sounds like the workaround maybe to apply the className in the column definition instead of in cloumnDefs?

    I don't see where you applied the className in either place but you do have columns: ':not(.noVis)' in your colvis button definition.

    Please try the http://live.datatables.net/sezigoti/5/edit example again and make the Age column visible. Also try the second example again to make sure whether the restore option works or not.

    Kevin

  • elimariaaaelimariaaa Posts: 30Questions: 11Answers: 0

    Hi Kevin,

    The problem with my datatables is that, my columns are dynamic. So I can't manually set them up, compared to columnDefs where I'm free to add whatever I want (hopefully the column visibility), too.

    Eli

This discussion has been closed.