destroy table troubles with hidden columns

destroy table troubles with hidden columns

AlexanderUAlexanderU Posts: 2Questions: 2Answers: 0

Hello!
I have a table with hidden columns:

function carsTableFync(source) {
$(document).ready(
        function() {
             CarTable = $("#car_table").DataTable({
                "data" : source,
                "columns" : [ {"data" : "carNum"}, 
                              {"data" : "capacity"}, 
                              {"data" : "tarifKm"}, 
                              {"data" : "percentOfLoad"}, 
                              {"data" : "loadType"}, 
                              {"data" : "carID", "visible" : false, "searchable" : false}, 
                                              {"data" : "carText", "visible" : false,   "searchable" : false}, 
                            ]
            });
})
}

i want to reload table with another data on mouse click. this is the code:

CarTable.destroy();
$('#car_table').empty();
carsTableFync(newData);

If I remove the hidden columns, all works fine, but they get an error: Cannot read property 'style' of undefined.
Anyone have an idea of what I should look for to fix the problem?

Answers

This discussion has been closed.