jquery datatables - cannot read property 'ntr' of undefined -
i getting error "cannot read property 'ntr' of undefined" when perform mouseover function on data-table when data not present. works fine when table populated. code follows:
$('#example_table tbody td').live('mouseover mouseout', function(event) { if (event.type == 'mouseover') {// on mouseover console.log('inside mouseover'); var ipos = otable.fngetposition( ); // getting error in line if(ipos!=null){ console.log(ipos); var icol= ipos [1]; } } }); what check should dont error
thanks
you check if table populated, , if not return:
$('#example_table tbody td').live('mouseover mouseout', function(event) { if (event.type == 'mouseover') {// on mouseover console.log('inside mouseover'); // check if have data in table if (otable.fngetdata().length <= 0) { // or similar check return; } var ipos = otable.fngetposition( ); // getting error in line if(ipos!=null){ console.log(ipos); var icol= ipos [1]; } } });
Comments
Post a Comment