fnGetData() actual content of table

fnGetData() actual content of table

joeyPablojoeyPablo Posts: 1Questions: 1Answers: 0
edited March 2016 in Free community support

I'm trying to get the content of my table after I edit it but when i check what i get by using fnGetData() is the old content :/ ?
Am i missing something ? ( btw i'm using DataTables v1.10.8 )

function save(){ // it's the function i call after editing the table rows by submiting
     var tableContent = $('#editableTable').dataTable();
     console.log(tableContent.fnGetData()); // here I get the old content
     $.ajax({
           type : "POST",
            url : "ajax",
            dataType : 'json',
            data : {
                json : JSON.stringify(tableContent.fnGetData())
             }
      });
}

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    data() or rows().data() is how I would recommend you do it with 1.10. You can use fnGetData but it is legacy and will be removed in the next major version.

    However, they will give you basically the same data as the legacy method so there is something else going on. We'd need a link to the page, as required in the forum rules.

    Allan

This discussion has been closed.