nodeName is undefined in Drill Down

nodeName is undefined in Drill Down

mrubertomruberto Posts: 2Questions: 0Answers: 0
edited March 2014 in DataTables 1.9
Hello,
I am having the error TypeError: mRow.nodeName is undefined when clicking on a row to expand the details. I cannot understand what is causing the error. Here is my data object from the list "history_data" passed into datatables.
[code]
{
"origin":"800275",
"purchase_id":false,
"move_lines":[
2487
],
"line_items":[
{
"origin":"800275",
"create_date":"2014-03-07 15:15:28",
"product_id":[
54,
"[67-00214] CAP WELDING SIZE 7 1/4"
],
"product_uom":[
17,
"EA"
],
"product_details":[
{
"description":"CAP WELDING SIZE 7 1/4",
"categ_id":[
10,
"VMI / Welding"
],
"default_code":"67-00214",
"seller_ids":[

],
"vendor_part_number":"1000-7 1/4",
"id":54,
"name":"CAP WELDING SIZE 7 1/4"
}
],
"note":false,
"location_dest_id":[
29,
"Berridge Input"
],
"product_qty":2.0,
"audit_fail":false,
"id":2487
}
],
"state":"draft",
"date":"2009-12-11 00:00:00",
"partner_id":[
9,
"Neopart"
],
"id":2556,
"product_id":[
54,
"[67-00214] CAP WELDING SIZE 7 1/4"
]
}[/code]

And here is my javascript:
[code]
$(document).ready(function(){
var anOpen = [];
var oTable = $('#contents').dataTable( {
"aaData": history_data,
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "/vmi/static/src/js/datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
},
"aoColumns":[
{
"mDataProp": null,
"sClass": "control center",
"sDefaultContent": ''
},
{"mData": "date"},
{"mData": "origin"},
{"mData": "purchase_id"},
{"mData": "state"}
]
} );
$('#contents td.control').live( 'click', function () {
var nTr = this.parentNode;
var i = $.inArray( nTr, anOpen );
if ( i === -1 ) {
$('img', this).attr( 'src', "/vmi/static/src/img/details_close.png" );
var nDetailsRow = oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
$('div.innerDetails', nDetailsRow).slideDown();
anOpen.push( nTr );
}
else {
$('img', this).attr( 'src', "/vmi/static/src/img/details_open.png" );
$('div.innerDetails', $(nTr).next()[0]).slideUp( function () {
oTable.fnClose( nTr );
anOpen.splice( i, 1 );
} );
}
} );
function fnFormatDetails ( nTr )
{
var aData = oTable.fnGetData( nTr );
var sOut = '';
sOut += 'SEPTA P/N'+aData.line_items[0].product_details[0].default_code+'';
sOut += 'Quantity'+aData.line_items[0].product_qty+'';
sOut += 'U of M'+aData.line_items[0].product_uom[1]+'';
sOut += 'Discrepency'+aData.line_items[0].audit_fail+'';
sOut += 'Category'+aData.line_items[0].product_details[0].categ_id[1]+'';
sOut += 'Location'+aData.line_items[0].location_dest_id[1]+'';
sOut += 'Vendor P/N'+aData.line_items[0].product_details[0].vendor_part_number+'';
sOut += 'Description'+aData.line_items[0].product_details[0].description+'';
sOut += '';
return sOut;
}
}); [/code]

Can you see what is causing this error?
Thanks in advance...

Replies

  • mrubertomruberto Posts: 2Questions: 0Answers: 0
    I got it. I didn't pass oTable to fnFormatDetails. My bad...
This discussion has been closed.