Arbitrarily fnOpen() a specific row (using ID) - how?

Arbitrarily fnOpen() a specific row (using ID) - how?

shamufishshamufish Posts: 14Questions: 0Answers: 0
edited November 2010 in General
Hi, I'm using the example for fnOpen successfully - for example I can click a row and it opens. That's because it's referenced dynamically this way:
[code]
$('#tasks tbody tr').click( function () {
that = this;
$('#tasks').dataTable().fnOpen( this, getDetailRow(this), "details_row" );
$('.details_row').click( function () {
$('#tasks').dataTable().fnClose(that);
} );
});
[/code]

The problem is I can't figure out how to arbitrarily open/close a row given a specific ID, for example even though:

[code]
$('#2083').html();
[/code]

... returns what's expected (because I tagged each row with the record unique ID as the ID="value")

[code]
$('#tasks').dataTable().fnOpen( $('#2083'), 'hello', "details_row" );
[/code]

... does nothing (although it does not error)
I tried doing an fnDraw() afterwards to no avail.

What am I missing?

Cheers!!!!

Replies

  • shamufishshamufish Posts: 14Questions: 0Answers: 0
    Actually I solved this - you need to pass the matching DOM element to fnOpen, not a Jquery reference.
    Solution is :

    [code]
    $('#tasks').dataTable().fnOpen( $('#2083').get(0), 'hello', "details_row" );
    [/code]
This discussion has been closed.