DataTables warning: table id='planprice' - Cannot reinitialise DataTable.
DataTables warning: table id='planprice' - Cannot reinitialise DataTable.
![Manyata sappe](https://secure.gravatar.com/avatar/eb096987340dd5b5e0b90a75af4853b5/?default=https%3A%2F%2Fvanillicon.com%2Feb096987340dd5b5e0b90a75af4853b5_200.png&rating=g&size=120)
Hi, am working with datatables, am getting the above error. i want show two datatables in my page so am initializing the datatable twice with two different id. Below is my code.
function planDT(planConfig,result){
planConfig.data=result;
var planDTtbl=$('#planslist').DataTable(planConfig);
return planDTtbl;
}
function planpriceDT(planpriceConfig,result){
planpriceConfig.data=result;
var planpriceDTtbl=$("#planprice").DataTable(planpriceConfig);
return planpriceDTtbl;
}
here is planConfig:
$scope.planConfig = {
"processing": true,
stateSave: true,
dom: 'Bfrltp',
"aoColumns": [{
"mData": "",
],
}
};
and result my json data result.
Please anyone hepl me.
Thank you in advance.
This discussion has been closed.
Answers
Hi @Manyata sappe ,
DataTables seems to think you're reinitialising the table with the id
#planprice
- so I'd start there. See if thatplanpriceDT
function is being called multiple times, or if you've put the ID on both your tables by accident. If still no joy, if you put a link to your page here, we can take a nose,Cheers,
Colin