DataTables GetData or GetHiddenNodes for filtered data

DataTables GetData or GetHiddenNodes for filtered data

joshgatewayjoshgateway Posts: 9Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
Hi Guys,

I've got a couple datatables in a form allowing people to select a user from a list and add them to another list. The tables are set up to scroll. The problem is is the check the input checkbox and then use the filter to search for something but don't clear it out, whatever they may have previously checked will not be submitted with the form. I've tried using the following:

[code]
var aTable_acc = $('.dataTable_accordion1').dataTable({
"bSortCellsTop": true,
"aaSorting": [[ 0, "asc" ]],
"sScrollY" : "311px",
"bPaginate": false,
"bScrollCollapse" : true,
// "bStateSave": true,
"oLanguage": {
"sInfo": "_TOTAL_ total records"
}
});

$(aTable_acc.fnGetData()).find('input:checked').appendTo(this).hide();
[/code]

and...
[code]
$(aTable_acc.fnGetHiddenNodes()).find('input:checked').appendTo(this).hide();
[/code]

but to no avail.

Any ideas on what I can use to grab the data?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Use the `$` API method: http://datatables.net/docs/DataTables/1.9.4/#$

    [code]
    aTable.$('tr').find( 'input.checked' );
    [/code]

    Allan
  • joshgatewayjoshgateway Posts: 9Questions: 0Answers: 0
    Thanks for your quick help Allan and such a great plugin. fnGetHiddenNodes ended up working, but I was using one identifier for multiple tables. Once I gave all the tables a unique identifier and used the fnGetHiddenNodes all was well. Rookie mistake..haha, thanks again!
This discussion has been closed.