Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82022

Getting column index from sName

$
0
0
Is there an easy way to get the index of a column from the sName of that column?

Something like:
var oTable = $('#example').dataTable();
var iColIndex = oTable.fnColIndex("exampleColumn");

alert( "Index of column with sName: exampleColumn is: " + iColIndex );

Right now I'm looping through aoColumns looking for the sName that I need which isn't very efficient to do for every time I need the column index. I know I can just create my own array with that data in it but just wondering if there is something already like that.

Thanks in advance!

Viewing all articles
Browse latest Browse all 82022

Trending Articles