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 :: reset value object js 
Javascript :: check if array is empty javascript 
Javascript :: vuejs show content on loaded 
Javascript :: show image javascript 
Javascript :: javascript remove json element 
Javascript :: express route parameters 
Javascript :: node js add new object to object array json 
Javascript :: convert celsius to fahrenheit javascript 
Javascript :: materialize dropdown js 
Javascript :: JSX Conditionals: && 
Javascript :: Relative Time momentjs 
Javascript :: vue cli debugger 
Javascript :: split whitespace except in quotes javascript 
Javascript :: vue 3 custom input component 
Javascript :: context api 
Javascript :: paper js text example 
Javascript :: mongoose updatemany example 
Javascript :: javascript ajax get 
Javascript :: counting sheep 
Javascript :: Iterate with Do While Loops Javascript 
Javascript :: change events 
Javascript :: dedecting invalid date in js 
Javascript :: byte to integer js 
Javascript :: update to node 15.11 
Javascript :: mongoose patch document 
Javascript :: insert isValidPhoneNumber in react hook form 
Javascript :: get window size on resizing 
Javascript :: react barcode scanner 
Javascript :: js exclude from object 
Javascript :: ajax timer 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =