Reset jquery datatables onclick function
Reset jquery datatables onclick function
inquisitive_stha
Posts: 7Questions: 6Answers: 0
$('#userDataTable').DataTable( {
"processing": true,
"serverSide": true,
"ajax": {
"url":base_path +'/admin/data/list',
"dataType":"json",
"type":"POST",
"data":{"_token":csrf_token}
},
"columns":[
{"data":"name"},
{"data":"created_at"},
{"data":"updated_at"},
{"data":"action","searchable":false,"orderable":false}
]
} );
Currently, am using this script to load data. Now, I want to reset the table while a href link is clicked. How, can I achieve this.
This discussion has been closed.
Answers
Hi @inquisitive_stha ,
You could run that same initialisation code again, but with
destroy
set totrue
, that way it'll recreate the table for you.Cheers,
Colin