Completely invisible columns.

Completely invisible columns.

myorkmyork Posts: 5Questions: 0Answers: 0
edited September 2011 in General
Is there currently a way to make columns invisible AND not have them show up in the list of available columns. In other words, is there a way to include a column but have it completely invisible to the user? The exist "bVisible" column parameter can be used to make a column visible, but it still show up in the list of columns for optional display.

The use case is that we would like to include some data in the rows that is used programmatically but that is of no use to the user.

Thank you.

- Matt

Replies

  • myorkmyork Posts: 5Questions: 0Answers: 0
    It looks like there is a way to do this, but it is not out-of-the-box compatible with column re-ordering.

    http://www.datatables.net/forums/discussion/3231/exclude-column-from-colvis/p1
    http://www.datatables.net/release-datatables/extras/ColVis/exclude_columns.html
    http://www.datatables.net/forums/discussion/4083/save-column-order-when-using-colvis-aiexclude/p1
  • GregPGregP Posts: 500Questions: 10Answers: 0
    Yup, this can be done if your data source is JSON. Inside the aoColumns (or aoColumnDefs) parameter of your dataTables initialization, you can specify the visible columns using mDataProp. Anything not specified is by default invisible and exists only as data.

    Since you just want to use the data programmatically, you don't really need column re-ordering, but I suspect it's also compatible with the DT extras. I know it works with the column re-ordering plugin at least.
This discussion has been closed.