help !!! now i use page reload, but i want to "datatable" reload only

help !!! now i use page reload, but i want to "datatable" reload only

anamanam Posts: 2Questions: 2Answers: 0
edited August 2016 in Free community support
$('.btnadd').bind('click', function(){    //click function to insert data
    var nis=$('#id').val();
    var name=$('#name').val();
    var alamat=$('#address').val();
    $.ajax({
    url: "../controller/student.php/add_student",
    type:"POST",
    data:"id="+id+"&name="+name+"&address="+address,
    success:function(){
    alert("data saved");
    location.reload();          // not it i want, but datatable reload only
    }
    });
  
    $('#id').val(null);
    $('#name').val(null);
    $('#address').val(null);
  
    });``

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I would suggest using ajax.reload() assuming you have an Ajax sourced table (without a test page showing the issue, which is required in the forum rules, it is impossible to say).

    Allan

This discussion has been closed.