Accessing the value of a hidden column for a selected row - possible?

Accessing the value of a hidden column for a selected row - possible?

kbowenkbowen Posts: 3Questions: 0Answers: 0
edited March 2010 in General
Two columns of what would be a 9-column table are 36-char database indexes (Google), so of course are hidden. The table implements user-selectable single rows following the Data Tables API example for this, and I use the fnGetSelected code from that example (added at the end for your convenience). However, it appears the nodes returned by fnGetNodes() in that code are the actual table row nodes. Is there a way to "reach behind" that node and get the internal data struct used by Data Tables? (Must be there since we can change the visibility of columns on the fly.)
I construct the table from a JS array DD obtained using DWR from the Google Java server, so I can use visible data from the selected row to look up the original entry in DD. But it would be much more efficient if I could grab the hidden values.
Comment aside: I'm new to Data Tables (and to jQuery), but this library is /very/ easy to set up and use. If I ever develop enough competence, I'll offer to help code some, but for now I'm head-down in a new self-funded startup.


[code]
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();

for ( var i=0 ; i

Replies

  • allanallan Posts: 63,145Questions: 1Answers: 10,403 Site admin
    Hi kbowen,

    You can make use of the fnGetData ( http://datatables.net/api#fnGetData ) API function. Pass it in a TR element, or an index (for aoData) and it will give you back an array of the data for that row - including hidden columns.

    Regards,
    Allan
This discussion has been closed.