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?

izumovizumov 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?

Replies

  • kthorngrenkthorngren Posts: 21,341Questions: 26Answers: 4,954

    The first problem is the you have Init.dt in line 1. Note the capital I. It should be lower case as showing in the init API. So the event handler never runs.

    debugger reports table is not defined

    This must be elsewhere in your code. Make sure the above code is executed before you initialize Datatables.

    Kevin

This discussion has been closed.