0👍
I found the solution I destroy the datable in the create function $(‘#sampleTable’).DataTable().destroy(); and then create it back like below
create() {
this.form.post('api/user').then(() => {
$("#addnew").modal("hide");
toast.fire({
icon: "success",
type: "success",
title: "Information Created Successfully!"
});
$('#sampleTable').DataTable().destroy();// here I destroyed the table
Fire.$emit("refreshPage");// here I recreated the table
this.form.reset();
})
.catch(er => {
console.log(er);
});
},
- [Vuejs]-Nuxt typescript building and transpile project for deployment
- [Vuejs]-Unable to get data from foreign key table in Laravel Vue addressbook project
Source:stackexchange.com