DT 1.9.4 - get column index from mData

DT 1.9.4 - get column index from mData

FlyLoFlyLo Posts: 1Questions: 1Answers: 0

Hi everyone,

I have to say this is one of the best jquery plugins i've worked with so far, but I still get stuck once in a while, like in this case.

The columns are defined through aoColumns, and the data source is obtained through fnServerData. In this case the client and server code is revolving around the name of the columns, instead of their index.

For DT 1.9 does anyone know what's the best way to obtain the index of a column if I know the mData value for that column?
An example where this is needed is for the aTargets property in aoColumnDefs objects.

I'd avoid creating a separate JS object that holds this information, because only the DataTable initialization object is already 150+ lines and I would prefer to have the code as small as possible.

I'm aware it is something really easy, it's just that my Google searching failed for this specific issue.

Thanks,
Dorian

This discussion has been closed.