How to call jquery for datatable after page load ??

How to call jquery for datatable after page load ??

corus123corus123 Posts: 3Questions: 1Answers: 0

Hello Sir , I have using bootstrap in my website . I have using jquery version 1.9.4 for datatables. It works Correctly when page run and data is loaded . I want to use jquery after button click and data load in tables. Waiting for your reply . Thanks in advance

Answers

  • chico3001chico3001 Posts: 4Questions: 1Answers: 0

    $('#table').dataTable({
    "ajax": test.php'
    });

    $("button").click(function(event) {
    event.preventDefault();
    $.post(
    "test.php",
    {name: "John",
    time: "2pm"})
    .done(function(data) {
    $('#table').DataTable().ajax.reload();
    });
    });

  • corus123corus123 Posts: 3Questions: 1Answers: 0

    When page is postback to the server and table is put in update panel the jquery not load again .

  • corus123corus123 Posts: 3Questions: 1Answers: 0

    I am using Asp.net

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    @chico3001's answer is the one I would give as well. You need a callback to execute the code that @chico3001 suggests (or a modification of it for your specific use case).

    Allan

This discussion has been closed.