dt.row(...).node(...) is null jquery.dataTable.responsive.js line:562
dt.row(...).node(...) is null jquery.dataTable.responsive.js line:562
larsonator
Posts: 54Questions: 4Answers: 2
I seem to get this error when a table is loaded, but there is no data to display.
This is inside the _resizeAuto function, there is a loop in there commented that it gets a clone of each row,
The each function roles into a function with and 'idx' parameter which seems to be an empty array when there is no data displayed on the table.
My understanding is that idx is supposed to represent a row number, so i fixed the issue by putting an number check.
dt.rows( { page: 'current' } ).indexes().each( function ( idx ) { if(idx instanceof Array) return; var clone = dt.row( idx ).node().cloneNode( true ); if ( dt.columns( ':hidden' ).flatten().length ) { $(clone).append( dt.cells( idx, ':hidden' ).nodes().to$().clone() ); } $(clone).appendTo( clonedBody ); } );
This discussion has been closed.
Replies
Can you try the 1.0.2-dev version: https://github.com/DataTables/Responsive/blob/master/js/dataTables.responsive.js . Should be fixed there.
Allan
Yeah for sure. Will have a look later today when im at a computer again.
The dev version worked for me! Thanks!