Using fnOpen with selector toggle - what am I doing wrong?
Using fnOpen with selector toggle - what am I doing wrong?
studioleland
Posts: 22Questions: 1Answers: 0
The following code works by clicking on the TR to extend another TR with any data. Great! But when I change the $('#example tbody tr').click() selector to something more specific in such as '#example tbody tr td.myclass a' the function fails. What am I missing. No doubt it has to do with the "this".
[code]
$(document).ready(function() {
var oTable;
// 'open' an information row when a row is clicked on
$('#example tbody tr').click( function () {
if ( oTable.fnIsOpen(this) ) {
oTable.fnClose( this );
} else {
oTable.fnOpen( this, "Temporary row opened", "info_row" );
}
} );
oTable = $('#example').dataTable();
} );
[/code]
[code]
$(document).ready(function() {
var oTable;
// 'open' an information row when a row is clicked on
$('#example tbody tr').click( function () {
if ( oTable.fnIsOpen(this) ) {
oTable.fnClose( this );
} else {
oTable.fnOpen( this, "Temporary row opened", "info_row" );
}
} );
oTable = $('#example').dataTable();
} );
[/code]
This discussion has been closed.
Replies
http://datatables.net/forums/discussion/1201/jquery-parent-element-versus-parentnode/p1