DataTables warning: table id='planprice' - Cannot reinitialise DataTable.

DataTables warning: table id='planprice' - Cannot reinitialise DataTable.

Manyata sappeManyata sappe Posts: 2Questions: 2Answers: 0
edited June 2018 in Free community support

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.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @Manyata sappe ,

    DataTables seems to think you're reinitialising the table with the id #planprice - so I'd start there. See if that planpriceDT 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

This discussion has been closed.