datatable dropdown toggle not working
$('#payment-notcompleted-table').DataTable().ajax.reload( function() {
// initialize dropdown
$('.dropdown-toggle').dropdown();
});
datatable dropdown toggle not working
$('#payment-notcompleted-table').DataTable().ajax.reload( function() {
// initialize dropdown
$('.dropdown-toggle').dropdown();
});
datatables and toggle not working
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
});
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us