[DT 1.10] Conditionnal columnDefs
[DT 1.10] Conditionnal columnDefs

Hello,
if cell #1 is equal to 10
columnDefs:[
{ targets: [ 5,6,7 ], visible: false, searchable: false },
{ targets: [ 1,2,3 ], visible: true, searchable: true }
]
if same cell is equal to 20
columnDefs:[
{ targets: [ 5,6,7 ], visible: true, searchable: true},
{ targets: [ 1,2,3 ], visible: false, searchable: false }
]
Is there a way to have only one line with an IF statement ?
Regards,
Marc
This discussion has been closed.
Replies
Hi @deliator ,
You could run that check before before you initialise the table, and store the
columnDefs
in a variable, which you then use at the initialisation.Cheers,
Colin