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

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -