Chytkam said: One issue I have been having is I would like to only have one row "open" at a time
$('#example td.control').live( 'click', function () {
var nTr = this.parentNode;
var i = $.inArray( nTr, anOpen );
$(anOpen).each( function () {
if ( this !== nTr ) {
$('td.control', this).click();
}
} );
if ( i === -1 ) {
$('img', this).attr( 'src', sImageUrl+"details_close.png" );
var nDetailsRow = oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
$('div.innerDetails', nDetailsRow).slideDown();
anOpen.push( nTr );
}
else {
$('img', this).attr( 'src', sImageUrl+"details_open.png" );
$('div.innerDetails', $(nTr).next()[0]).slideUp( function () {
oTable.fnClose( nTr );
anOpen.splice( i, 1 );
} );
}
} );
} );
$('#item_table td.control').live( 'click', function () {
var nTr = this.parentNode;
var i = $.inArray( nTr, anOpen );
$(anOpen).each( function () {
if ( this !== nTr ) {
$('td.control', this).click();
}
} );
if ( i === -1 ) {
$('img', this).attr( 'src', sImageUrl+"details_close.png" );
$('div.innerDetails', nDetailsRow).slideDown();
var nDetailsRow = oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
anOpen.push( nTr );
$(nTr).addClass('row_selected');
clickedRowId = $(nTr).attr('id');
$('#btnEditRow').button( "option", "disabled", false );
} else {
$('img', this).attr( 'src', sImageUrl+"details_open.png" );
$('div.innerDetails', $(nTr).next()[0]).slideUp( function () {
$(nTr).removeClass('row_selected');
clickedRowId = 0;
oTable.fnClose( nTr );
anOpen.splice( i, 1 );
$('#btnEditRow').button( "option", "disabled", true );
} );
}
return false;
} ); var aData = oTable.fnGetData( nTr ); var id = aData[1];
var id = $(nTr.children[1]).html();
fnOnAdded: function(status)
{
oTable.fnDraw(false);
$(anOpen).each( function () {
if ( this == nTr ) {
$('td.control', this).click();
}
});
return true;
}
but no luck.
<table>
<thead></thead>
<tbody>
<tr>
<td>"parent" table</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>nested table</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.