Show Columns Based on SQL Value
Show Columns Based on SQL Value
rcwebadmin
Posts: 8Questions: 4Answers: 0
in General
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.
This discussion has been closed.
Answers
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 ininitComplete
.There isn't a built in option for that - but there effectively no built in options for JSON control of the table.
Allan