Column Index of Hiddend Colum in Responsive Comanche Datatables

Column Index of Hiddend Colum in Responsive Comanche Datatables

GiovanniGiovanni Posts: 9Questions: 2Answers: 0
edited October 2013 in General
Hi all,
I'm getting crazy since I cannot find an answer to following question in the forum. Please help me.
I am using Comanche plug-in to make datatables responsive; I need to modify some classes, contents and values on some specific columns and I use fnRawCallback to apply my styles and values and it works great.
The problem is that since the table is responsive, index columns change on different screens (tablet, pcs, smartphones) because I need to hide some columns. Here below an example where I replace the ITA string (I load JSON data and ITA string is at position 8 in the row) with a Italian flag.

[code]var flag = '';
$('td:eq(8)', nRow).html(flag);[/code]


It works ok until I Hide some columns before position 8. That is, while in largest screen I keep all data from 0 to 8, on smallest screens (such as tablet), I hides some columns and the column index in datatables change.

How can I get the always the correct index on
[code]$('td:eq(8)', nRow).html(flag);[/code]

Thanks in advance

Giovanni

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Use this plug-in: http://datatables.net/plug-ins/api#fnGetTds

    Allan
  • GiovanniGiovanni Posts: 9Questions: 2Answers: 0
    Great. It works perfectly

    Thanks a lot
This discussion has been closed.