Show Columns Based on SQL Value

Show Columns Based on SQL Value

rcwebadminrcwebadmin Posts: 8Questions: 4Answers: 0

Is there a way to show various columns based on a SQL Value? I know there is the visible: false option but I would like to be able to show or hide a column based on a sql value from a table like a 1/0 or something similar.

Answers

  • allanallan Posts: 63,686Questions: 1Answers: 10,500 Site admin

    You can use columns().visible() to define the visibility of columns. DataTables itself puts no restrictions on how or when you call that method - for example you might include it in the JSON data used to load the table and use the API method in initComplete.

    There isn't a built in option for that - but there effectively no built in options for JSON control of the table.

    Allan

This discussion has been closed.