Accessing hidden column data

Accessing hidden column data

spascospasco Posts: 3Questions: 0Answers: 0
edited February 2011 in General
I'm trying to access data from columns that's hidden. I've reviewed similar forum posts and tried using fnGetTds with no luck.

http://www.datatables.net/plug-ins/api#fnGetTds
http://datatables.net/forums/comments.php?DiscussionID=2045

A typical consists of the following and only [1] - [4] are visible (as seen below in aoColumns):

[code]

1
Argo Float Data from
NOAA, NCAR
NIDS
GRID
Meta info
Publisher Info
Creator Info
Documention
Variables
Access
Viewers

[/code]
[code]
"aoColumns": [
/* Id */ {"bVisible": false},
/* Title */ null,
/* Provider */ null,
/* Format */ null,
/* Type */ null,
/* MetaInfo */ {"bVisible":false},
/* Publisher Info */ {"bVisible":false},
/* Creator Info */ {"bVisible":false},
/* Documentation */ {"bVisible":false},
/* Variables */ {"bVisible":false},
/* Access */ {"bVisible": false},
/* Viewers */ {"bVisible": false}
]
[/code]

Now, the jQuery function with which I'd like to grab the Id data, for example, ID[0] is:

[code]
$("#example tbody tr").click(function(event) {

// Upon deselect of a row, turns that row's highlighting off
$(oTable.fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
});

// Highlights selected row
$(event.target.parentNode).addClass('row_selected').text();

// Expands right pane panels when row is selected. Also closes panels if already expanded.
$('#eastMultiOpenAccordion h3').trigger('click');

// Using fnGetData()
var anTds = oTable.fnGetTd(this,0,0);
console.log(anTds);

});
[/code]

Using fnGetData, I'm still only able to get the "visible" values. I need to grab all the values given the click event my function provides.

How do I accomplish this?

Thank you,
Stephen

Replies

  • spascospasco Posts: 3Questions: 0Answers: 0
    I figured it out. This line of code allows me to get the hidden table data I need:

    [code]
    var aData = oTable.fnGetData(this);
    [/code]
    [code]
    $("#example tbody tr").click(function(event) {

    // Upon deselect of a row, turns that row's highlighting off
    $(oTable.fnSettings().aoData).each(function (){
    $(this.nTr).removeClass('row_selected');
    });

    // Highlights selected row
    $(event.target.parentNode).addClass('row_selected').text();

    // Expands right pane panels when row is selected. Also closes panels if already expanded.
    $('#eastMultiOpenAccordion h3').trigger('click');

    // Using fnGetData()
    var aData = oTable.fnGetData(this);

    });
    [/code]
This discussion has been closed.