How can I find the column number using column name
How can I find the column number using column name

Is it possible to find the column position number using the column name. For example column 'Position' some times it would be column 0 some time it would be column 2. So How can I find the column number using the column name
$('#example').dataTable( {
"columnDefs": [ {
"targets": [ 0, 2 ],
"orderable": false
} ]
} );
This discussion has been closed.
Answers
Hi @polachan ,
Yep, you can use
columns.name
, see here.Cheers,
Colin