Drilldown not displaying details row
Drilldown not displaying details row
jasonaleski
Posts: 7Questions: 0Answers: 0
I have a drilldown that I cannot get the details row to show. Below is a video and code. I've tried using different techniques to get the details to show, but no luck.
Screencast
http://screencast.com/t/LAwkJ7jvQQ73
Code
http://live.datatables.net/ireruh/edit#javascript,html
Suggestions?
Screencast
http://screencast.com/t/LAwkJ7jvQQ73
Code
http://live.datatables.net/ireruh/edit#javascript,html
Suggestions?
This discussion has been closed.
Replies
Allan
[code]
var oTable;
function fnFormatDetails(nTr){
var aData = oTable.fnGetData(nTr);
var sOut = ''+
''+
'Location Information'+aData.SONBR+''+
''+
'';
console.log("DETAILS: "+sOut);
return sOut;
}
$(document).ready(function(){
var sImageUrl = "includes/";
oTable = $('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": "json.php",
"aoColumns": [
{ "mDataProp": null,
"sClass": "control center",
"sDefaultContent": ''
},
{"mDataProp": "SONBR"},
{"mDataProp": "SODATE"},
{"mDataProp": "SOTIME"},
{"mDataProp": "SOFUNC"},
{"mDataProp": "LOCNBR"},
{"mDataProp": "DISNBR"},
{"mDataProp": "CONNBR"}
]
});
console.log("STATUS: Data tables initialized.");
$('#example tbody').on('click', 'td img', function () {
var nTr = $(this).parents('tr')[0];
console.log("VALUES: ntr = "+nTr);
if (this.src.match('details_close.png')) {
/* This row is already open - close it */
console.log("CLICK: Close Details");
this.src = sImageUrl+"details_open.png";
oTable.fnClose(nTr);
}else{
/* Open this row */
console.log("CLICK: Open Details");
this.src = sImageUrl+"details_close.png";
oTable.fnOpen(nTr, fnFormatDetails(nTr), 'details' );
}
});
});
[/code]