📅  最后修改于: 2022-03-11 15:02:58.587000             🧑  作者: Mango
CAUSE
Pages other than first do not exist in DOM at the time of initialization, that is why your handler never gets called.
SOLUTION
You need to use event delegation by providing selector as a second argument in on() call, see example below:
$(document).ready(function(){
$('#table_name').DataTable();
$('#table_name').on('click', '.some-toggle-class', function(){
// your code here
});
});