how to refresh data when array changes?

how to refresh data when array changes?

uffa14uffa14 Posts: 2Questions: 1Answers: 0
edited September 2015 in Free community support

Hi,
Using datatable to show a google spreadsheet via Google Apps Scripts and Javascript, jquery, datatables.

The spreadsheet data are passed to the datatable as an array.

Users can edit a row using a button, changes are saved in the spreadsheet and the array is passed again with the chnaged data.

But i don't know how to show the new data again (without press F5 to reload the entire page :-))

Thanks for any help.

Marco

I've posted a sample code here
http://live.datatables.net/jimubinu/1/edit

Answers

  • uffa14uffa14 Posts: 2Questions: 1Answers: 0

    finally found a way out... .just cleared the table and reload all rows

    var oTable = $('#tbprocedimenti').DataTable();
    oTable.clear( );
    for (var k = 0; k < arrProcedimenti.length; k++){
           oTable.row.add(arrProcedimenti[k]);       
    }
    oTable.draw();
    

    Is this the only way?

This discussion has been closed.