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
anam
Posts: 2Questions: 2Answers: 0
$('.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);
});``
This discussion has been closed.
Answers
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