Initializing a sub-table

Initializing a sub-table

ZacWolfZacWolf Posts: 5Questions: 0Answers: 0
edited July 2012 in General
Hello, I have a master table, that contains a sub-table on one column of each row.

I'm using a pagination UI, showing only one "row" per page (each row/page contains a 360px tall image in column 1, and the sub-table in column 3):

[code]"bJQueryUI": true,
"sScrollY": "362px",
"bPaginate": true,
"bLengthChange": false,
"sPaginationType": "full_numbers",
"iDisplayLength": 1,
"bProcessing": true[/code]

Because I'm using pagination, the sub-table in the "unrendered" pages/rows is not query-able from the DOM until AFTER each row/page is rendered, so trying to initialize the sub-table via fnRowCallback doesn't actually render the subtable (until you go to another page, and then come back).

[code]"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var eid = aData[1];
if ($("#savesforeid"+eid)!=null){ //sub-table ID
$("#savesforeid"+eid).dataTable({"bJQueryUI": true,
"sScrollY": "300px",
"bScrollCollapse": true,
"bScrollInfinite": true,
"bPaginate": false
"bInfo": false,
"bProcessing": true
});
}
}[/code]

So my question: is there any kind of "post render row" callback that I can tap into, or if not how would I force a redraw of a single row/page?

THANKS!
-Zac

Replies

  • ZacWolfZacWolf Posts: 5Questions: 0Answers: 0
    I figured it out; through a combination of:

    [code]"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {},
    "fnDrawCallback": function( oSettings ) {}[/code]

    I set a document scoped "var" of the current page being displayed in the fnRowCallback, and then I on the fnDrawCallback callback I use that to test if the sub-table has been initialized.

    If anyone wants to see the full example, just let me know.
This discussion has been closed.