Display/Hide row details on click on 'TR' elements
Display/Hide row details on click on 'TR' elements
If you interested to click on your TR to display a row detail, use this code to replace default "datatable" code
[code]
$('#tab_annonces tbody tr').live('click', function () {
oTable =$('#tab_annonces').dataTable();
var nTr = this;
var nImg = nTr.childNodes[0].childNodes[0];
if (nImg.src.match('details_close'))
{
/* Close this row */
nImg.src = "../_ajax/datatables/images/details_open.png";
oTable.fnClose( nTr );
}
else
{
/* Open this row */
nImg.src = "../_ajax/datatables/images/details_close.png";
oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
}
} );
[/code]
[code]
$('#tab_annonces tbody tr').live('click', function () {
oTable =$('#tab_annonces').dataTable();
var nTr = this;
var nImg = nTr.childNodes[0].childNodes[0];
if (nImg.src.match('details_close'))
{
/* Close this row */
nImg.src = "../_ajax/datatables/images/details_open.png";
oTable.fnClose( nTr );
}
else
{
/* Open this row */
nImg.src = "../_ajax/datatables/images/details_close.png";
oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
}
} );
[/code]
This discussion has been closed.