Trouble using afnFiltering in combination with hidden columns.

Trouble using afnFiltering in combination with hidden columns.

bryceray1121bryceray1121 Posts: 65Questions: 0Answers: 0
edited December 2011 in Plug-ins
[code]
iniFilter = function(selector){
var tables = $jq(selector);
var i;
for ( i=0, iLen=tables.length ; i

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    By post and pre-javascript do you mean post and pre-hiding of the columns by DataTables?

    To get an array of all TD elements, including hidden ones you can use this plug-in: http://datatables.net/plug-ins/api#fnGetTds . The only thing I would say about this approach is that it is going to be slow - since you are doing so much DOM and general processing for every row. Is the index the same for all rows? It might be better to calculate it before you call whatever is triggering the filter and then just use that "static" value.

    Allan
  • bryceray1121bryceray1121 Posts: 65Questions: 0Answers: 0
    Unfortunately, the index is dynamic. I'm having a little trouble integrating the fnGetTds into my flow. Before, I do this I have a question which may simplify it. Is it possible to grab a list of all header cells (th) visible and hidden. Could I then use this data to check for the index of a th cell with a given class?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    There isn't currently a plug-in that will do that, but you could get the list by looping over fnSettings().aoColumns[].nTr . The nTr property of each column object is the header cell for that column.

    Allan
This discussion has been closed.