aoData is null when expanding details of a row

aoData is null when expanding details of a row

southfanningsouthfanning Posts: 8Questions: 1Answers: 0
edited February 2013 in Blog
I've been working on this for a few nights and I'm just not getting anywhere.

I'm displaying a datatable inside an accordion. It works great for the most part. The problem is, if I load the same table more than once, I get an 'aoData' is null error when expanding the row. Details work fine the first time.

Any ideas?

var oTable = $('#'+category).dataTable( {
"bProcessing": false,
"bDestroy": true,
"aaData": patJson,
"bAutoWidth": false,
"aoColumns": [
{
"mDataProp": null,
"sClass": "control center",
"sDefaultContent": '',
"sWidth": "5%"
},
{ "mDataProp": "S_PAT_NAME", "sWidth": "30%" },
{ "mDataProp": "S_AGE", "sWidth": "15%"},
{ "mDataProp": "S_FIN", "sWidth": "30%"},
{ "mDataProp": "S_ROOM_BED", "sWidth": "20%" }
]
} );

$('#'+category+' td.control').live( 'click', function ()
{
var nTr = this.parentNode;
var i = $.inArray( nTr, anOpen );

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 );
} );
}
} );
This discussion has been closed.