How can i get all columns with fnGetNodes() function after i hide some columns?

How can i get all columns with fnGetNodes() function after i hide some columns?

andy65007andy65007 Posts: 2Questions: 0Answers: 0
edited May 2010 in General
After i hide columns at initial datatable phase, the function fnGetNodes() just return columns which set visile to display, Is there aother api i can use to get the entire table row(include hided columns)?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    fnGetNodes will get the TR element, rather than TDs - so I presume you are just doing a DOM query to get the TD elements required - in which case, you are absolutely correct, the hidden TDs are removed (for the reason that they are not to be displayed!).

    If you want the hidden TD elements during the normal flow you need to get them from the internal store that DataTAbles keeps for them.

    [code]
    var aoData = oTable.fnSettings().aoData;
    var aiPos = oTable.fnGetPosition();
    var nTd = aoData[ aiPos[0] ]._anHidden[ aiPos[1] ];
    [/code]
    That should do it.

    It would probably be good to have this wrapped into an API plug-in function which will take something like:

    fnGetTd( row TR | position , TD index );

    and that would abstract out the complication of getting hidden data...

    Added to the to do list :-)

    Allan
  • andy65007andy65007 Posts: 2Questions: 0Answers: 0
    Thanks very much
This discussion has been closed.