Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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
    });   
});
Comment

datatable dropdown toggle not working

$('#payment-notcompleted-table').DataTable().ajax.reload( function() {
  // initialize dropdown
  $('.dropdown-toggle').dropdown();
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: math floor javascript 
Javascript :: round down html 
Javascript :: mongoose mongodb updateone 
Javascript :: rngesturehandlermodule.default.direction react native 
Javascript :: vue 3 
Javascript :: regex not a value 
Javascript :: find second smallest number in array javascript using for loop 
Javascript :: for of and for in javascript 
Javascript :: mock createRef jest react functional component 
Javascript :: fsm2regex 
Javascript :: Fill rect in jspdf 
Javascript :: onpress not working when textinput isfocused in react native 
Javascript :: shopify bypass cart 
Javascript :: react carousel 
Javascript :: .reduce javascript 
Javascript :: Material-ui wallet icon 
Javascript :: what is symbol in javascript 
Javascript :: how to check if a browser is supported 
Javascript :: vue router push with params 
Javascript :: javascript get all elements of an id 
Javascript :: javascript link to google maps route 
Javascript :: only allow requests from domain express 
Javascript :: javascript while loops 
Javascript :: ValueError: dictionary update sequence element #0 has length 1; 2 is required 
Javascript :: javascript scale values 
Javascript :: ipcrenderer preload.js 
Javascript :: render text in for loop react in function 
Javascript :: chai async test 
Javascript :: inline if statement javascript 
Javascript :: How to find out what character key is pressed?#key#keyCode#code 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =