DataTables hidden row details example is not working [PLEASE HELP]
DataTables hidden row details example is not working [PLEASE HELP]
Hi all I have a problem,
I want to use hidden row details option. I am getting error from the server
Btw my table was working perfectly before this:
[code]
$(document).ready(function () {
var nCloneTh = document.createElement('th');
var nCloneTd = document.createElement('td');
nCloneTd.innerHTML = '';
nCloneTd.className = "center";
$('#jphit thead tr').each(function () {
this.insertBefore(nCloneTh, this.childNodes[0]);
});
$('#jphit tbody tr').each(function () {
this.insertBefore(nCloneTd.cloneNode(true), this.childNodes[0]);
});
//Init
var oTable = $('#jphit').dataTable({
"sDom": 'T,C<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf"
},
"oColVis": {
"buttonText": "Extend table",
"activate": "mouseover"
},
"aoColumnDefs": [{
"bVisible": false,
"aTargets": [0]
}],
"aaSorting": [
[1, 'asc']
],
"bProcessing": true,
"bServerSide": true,
"sScrollY": "350px",
"bStateSave": true,
"sPaginationType": "full_numbers",
"bDeferRender": true,
"sAjaxSource": "increment_table.php"
});
//setInterval(function(){oTable.fnDraw();},5000);
$('#jphit tbody td img').live('click', function () {
var nTr = $(this).parents('tr')[0];
if (oTable.fnIsOpen(nTr)) {
/* This row is already open - close it */
this.src = "images/details_open.png";
oTable.fnClose(nTr);
} else {
/* Open this row */
this.src = "images/details_close.png";
oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'details');
}
});
});
function fnFormatDetails(oTable, nTr) {
var aData = oTable.fnGetData(nTr);
var sOut = '';
sOut += 'Rendering engine:Sometinh';
sOut += 'Link to source:Could provide a link here';
sOut += 'Extra info:And any further details here (images etc)';
sOut += '';
return sOut;
}
[/code]
And my debug link: http://debug.datatables.net/odeqah
Please help
I want to use hidden row details option. I am getting error from the server
Btw my table was working perfectly before this:
[code]
$(document).ready(function () {
var nCloneTh = document.createElement('th');
var nCloneTd = document.createElement('td');
nCloneTd.innerHTML = '';
nCloneTd.className = "center";
$('#jphit thead tr').each(function () {
this.insertBefore(nCloneTh, this.childNodes[0]);
});
$('#jphit tbody tr').each(function () {
this.insertBefore(nCloneTd.cloneNode(true), this.childNodes[0]);
});
//Init
var oTable = $('#jphit').dataTable({
"sDom": 'T,C<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf"
},
"oColVis": {
"buttonText": "Extend table",
"activate": "mouseover"
},
"aoColumnDefs": [{
"bVisible": false,
"aTargets": [0]
}],
"aaSorting": [
[1, 'asc']
],
"bProcessing": true,
"bServerSide": true,
"sScrollY": "350px",
"bStateSave": true,
"sPaginationType": "full_numbers",
"bDeferRender": true,
"sAjaxSource": "increment_table.php"
});
//setInterval(function(){oTable.fnDraw();},5000);
$('#jphit tbody td img').live('click', function () {
var nTr = $(this).parents('tr')[0];
if (oTable.fnIsOpen(nTr)) {
/* This row is already open - close it */
this.src = "images/details_open.png";
oTable.fnClose(nTr);
} else {
/* Open this row */
this.src = "images/details_close.png";
oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'details');
}
});
});
function fnFormatDetails(oTable, nTr) {
var aData = oTable.fnGetData(nTr);
var sOut = '';
sOut += 'Rendering engine:Sometinh';
sOut += 'Link to source:Could provide a link here';
sOut += 'Extra info:And any further details here (images etc)';
sOut += '';
return sOut;
}
[/code]
And my debug link: http://debug.datatables.net/odeqah
Please help
This discussion has been closed.
Replies