why shows " DataTables warning: table id=example1 - Cannot reinitialise DataTable. " error?
why shows " DataTables warning: table id=example1 - Cannot reinitialise DataTable. " error?
![munna420](https://secure.gravatar.com/avatar/c6db607b64325eeb9c77ffd7afddaa1d/?default=https%3A%2F%2Fvanillicon.com%2Fc6db607b64325eeb9c77ffd7afddaa1d_200.png&rating=g&size=120)
Error messages shown:
$(function childCategory() {
let table = $('.ytable').DataTable({
processing: true,
serverSide: true,
ajax: "{{route('childcategory.index')}}",
columns: [
{data: 'DT_RowIndex', name: 'DT_RowIndex'},
{data: 'category_name', name: 'category_name'},
{data: 'subcategory_name', name: 'subcategory_name'},
{data: 'childcategory_name', name: 'childcategory_name'},
{data: 'slug', name: 'slug'},
{data: 'action', name: 'action', oderable: true, serchable: true}
]
});
});
Answers
Did you follow the troubleshooting steps at the link in the error?
https://datatables.net/manual/tech-notes/3
My guess is you are calling the function childCategory() more than once and using the class
ytable
to initialize multiple tables which is reinitializing previously initialized Datatables.If you still need help please post a link to your page or a test case replicating the issue so we can see what you have to offer suggestions.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin