How to reload Datatable without refreshing the page?
What is the process to reload data without refreshing the page using datatable jquery? My reload table was not working.
my view is :
Kategori
Deskripsi
Tipe Kategori
Slug
Aktif
Opsi
kategori;?>
deskripsi;?>
parent_kategori == "0"){
echo "";
}else{
echo "";
}?>
slug;?>
aktif == "Y"){
echo "";
}elseif($ambil_data->aktif == "N"){
echo "";
}?>
When insert data this my jquery :
function reload_table(){
table.ajax.reload(null,false); //reload datatable ajax
}
function save()
{
var url;
if(save_method == 'add')
{
url = "";
}
else
{
url = "";
}
// ajax adding data to database
$.ajax({
url : url,
type: "POST",
data: $('#form').serialize(),
dataType: "JSON",
success: function(data)
{
//if success close modal and reload ajax table
$('#modal_form').modal('hide');
reload_table();
},
error: function (jqXHR, textStatus, errorThrown)
{
alert('Error adding / update data');
}
});
}
Is there anything that I am doing wrong?
Privacy & Cookie Consent
We use cookies to ensure the best experience on our website. This includes analytics, personalization, and marketing purposes. Some cookies are essential for the website to function properly.
By clicking "Accept", you consent to our use of cookies. You can read more about how we use cookies and how you can change your preferences in our Privacy Policy.