table doesn't reinitialise after destroy method.

table doesn't reinitialise after destroy method.

AlexanderUAlexanderU Posts: 2Questions: 2Answers: 0

Hello!
i'm using the autocomplete function from Jquery to select the input parameter from JSON file.
first time, all work perfectly. But when i try change value in autocomplete, a table is not reinitialise.
This is my code:

var oTable;
function tableFync(source) {
            $(document).ready(function() {
                                oTable = (oTable) ? oTable.destroy(true)  : oTable; 
                                
                                
                                    oTable = $("#delivery_table").DataTable({
                                    
                                    "data" : source,
                                    "columns" : [ {"data" : "address"}, 
                                                  {"data" : "time"}, 
                                                  {"data" : "countLots"}, 
                                                  {"data" : "loadType"}, 
                                                  {"data" : "latitude", "visible" : false, "searchable" : false }, 
                                                  {"data" : "longitude", "visible" : false, "searchable" : false}, 
                                                  {"data" : "id", "visible" : false,    "searchable" : false}, 
                                                ]
                                }); 
This discussion has been closed.