• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

105
Views
How do you listen to jquery datatable event after updates and not before

I'd like to update dom elements after the default datatable updates are completed, such as searching and sorting. The problem is the following event listening fires before the actual sort or search: I want my code to execute after the sort or search is completed. Thank you.

 $('#dTable').DataTable({
        "numbering": false,
        "searching": true,
        "paging": true,
        "ordering": true,
        "bLengthChange": false,
        'iDisplayLength': 10,
        "info": false,
        "scrollCollapse": true,
      
    }).on('draw', function () {

        //my dom update code -- problem is my update code executes before the sort or search is completed; 
      //i want my code to execute only after its completed

           $(".dom_element").html("sort or search completed");
    });
about 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

figured it out!!

$('#dTable').DataTable({
    "numbering": false,
    "searching": true,
    "paging": true,
    "ordering": true,
    "bLengthChange": false,
    'iDisplayLength': 10,
    "info": false,
    "scrollCollapse": true,
 
    "fnDrawCallback": function () {
          
            //write dom update code here...

            return false;
        }

 })
about 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error