Column Visibility (is this correct?)

Column Visibility (is this correct?)

nettlesdnettlesd Posts: 22Questions: 5Answers: 0
edited November 2014 in Free community support

Hello everyone,

Just seeing if I have the options correct. I'm trying to turn the visibility off for the course column. I used the example for "grouping" and that works but my course still shows in the last column. If my options are correct then I'll look elsewhere.

Here's the options I'm using.

Table = $("#Members").DataTable( {
                responsive: true,
                "pageLength": 50,
                "ajax": {
                  "url": Path + "some URL"
                },
                "columnDefs": [ 
                  { "targets": 0,
                    "searchable": true,
                    "data": "sso_id"
                  },
                  { "targets": 1,
                    "searchable": true,
                    "data": "first_name"
                  },
                  { "targets": 2,
                    "data": "last_name",
                    "searchable": true
                  },
                  { "targets": 3,
                    "data": "role",
                    "searchable": true
                  },
                  { "targets": 4,
                    "data": "action",
                    "searchable": true
                  },
                  { "targets": 5,
                    "data": "selection",
                    "searchable": false
                  },
                  { "targets": 6,
                    "data": "info",
                    "searchable": false
                  },
                  { "targets": 7,
                    "data": "email",
                    "searchable": false
                  },
                  { "targets": 8,
                    "data": "lock",
                    "Searchable": false
                  },
                  { "targets": 9,
                    "data": "delete",
                    "searchable": false
                  },
                  { "targets": 10,
                    "data": "course",
                    "searchable": false,
                    "visible": false
                  }
                  
                ]

.... more options etc

This question has an accepted answers - jump to answer

Answers

  • nettlesdnettlesd Posts: 22Questions: 5Answers: 0

    I see what's happening. As I said, I was using the "row grouping" example but my column that I had "visible :false" was still being displayed. If I remove the "responsive: true" parameter than it works exactly like the example with the column being hidden.

    Is there any work around for this? Maybe a bug?

  • allanallan Posts: 61,041Questions: 1Answers: 9,955 Site admin

    The Responsive extension takes complete control of the column visibility. If you want the column to never be shown add the class never to the column using columns.className. See the Responsive manual for more details.

    Allan

  • nettlesdnettlesd Posts: 22Questions: 5Answers: 0

    Perfect. Thank you.

    How did you format my options? Just so I know for next time. Something like [code][/code] surrounding the javascript.

  • allanallan Posts: 61,041Questions: 1Answers: 9,955 Site admin
    Answer ✓

    Using Markdown.

    Allan

This discussion has been closed.