Viewing file properties with a data table

0

I have some objects with two properties, name and tags, that simulate being files. Then I use a data table to display them. The thing is like this: The problem : I have a drawData function that makes me appear the tablar. But when I add new data, which simulate being new files with their tags and I call the function again, the image is not updated, that is, it does not show me the new "files" I have entered. The function that is responsible for drawing the table is this:

function drawData(){
$(document).ready(function() {
    $('#example').DataTable( {
        data: dataSet, 
        columns: [
            { title: "FileName" },
            { title: "Tags" },
                 ]
    } );
} );

}

Does anyone know how I can refresh the graphics in my table so that new data appears?

    
asked by Mr. Baldan 20.10.2018 в 14:16
source

1 answer

1

I have worked with dataTable and according to what I understand is that you can not call the same function if it has already been called, since it can not be restarted, you could destroy the function with this method $ ("# tablaRegistros ") .dataTable (). fnDestroy (); and put it back, look at this reference: link

    
answered by 20.10.2018 / 17:10
source