why in an event init on access to the table do I get an error?
why in an event init on access to the table do I get an error?
izumov
Posts: 178Questions: 14Answers: 0
my code
$('#goods').on( 'Init.dt', function () {
var table=$('#goods').DataTable();
var length = table.data().count();
//});
var length = table.data().count();
// $('#myInput').val( data.myCustomValue );
} );
debugger reports table is not defined. where am I making a mistake?
This discussion has been closed.
Replies
The first problem is the you have
Init.dt
in line 1. Note the capitalI
. It should be lower case as showing in theinit
API. So the event handler never runs.This must be elsewhere in your code. Make sure the above code is executed before you initialize Datatables.
Kevin