Reputation: 327
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? (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())
}
});
}
Upvotes: 0
Views: 675
Reputation: 327
I've forgot to add these two lines! now it works thanks NiallMitch14 for your comment.
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( value, aPos[0], aPos[1] );
Upvotes: 1