showing results for - "datatables and toggle not working"
Paul
17 Apr 2020
1$('#payment-notcompleted-table').DataTable().ajax.reload( function() {
2  // initialize dropdown
3  $('.dropdown-toggle').dropdown();
4});
Malia
09 Apr 2019
1CAUSE
2Pages other than first do not exist in DOM at the time of initialization, that is why your handler never gets called.
3
4SOLUTION
5You need to use event delegation by providing selector as a second argument in on() call, see example below:
6$(document).ready(function(){
7    $('#table_name').DataTable();
8
9    $('#table_name').on('click', '.some-toggle-class', function(){
10        // your code here
11    });   
12});
13