How to reload Datatable without refreshing the page?
05:37 09 Feb 2017

What is the process to reload data without refreshing the page using datatable jquery? My reload table was not working.

my view is :

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?

php jquery ajax codeigniter
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 ""; }?>