Arbitrarily fnOpen() a specific row (using ID) - how?
Arbitrarily fnOpen() a specific row (using ID) - how?
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!!!!
[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!!!!
This discussion has been closed.
Replies
Solution is :
[code]
$('#tasks').dataTable().fnOpen( $('#2083').get(0), 'hello', "details_row" );
[/code]