Hassanj343 / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

prevent refresh of all table after editing cell #125

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

I'm using jquery.dataTables.editable.js (2.3.2) and can't understand how to 
prevent refresh of the whole table when I make a change in on cell.

I have one DataTable which gets data via AJAX. It uses such options
"sAjaxSource": {some_url},
"bServerSide": "true",
"bProcessing": "true"

I also have makeEditable() for this DataTable with 
sUpdateURL: {some_url} for cells.

When I edit one cell, the cell is updated successfully, but then the whole 
table is refreshed again. I can't understand how to prevent it.

Thanks

Original issue reported on code.google.com by distinct...@googlemail.com on 23 Aug 2012 at 11:14

GoogleCodeExporter commented 9 years ago
I've got version 2.3.3.

In the definition of the function fnSetDisplayStart() remove comments from the 
"if" block:
if (oSettings.oFeatures.bServerSide === false) {
...
}

There is another defect: if you do row update from the ajax popup form, the app 
refreshes the table <number of columns in the form> times. It doesn't make 
sense in case of server side processing. To fix it, alter the definition of the 
function fnUpdateRowOnSuccess(nActionForm) as follows.
Add line:
var bRefreshTable = !oSettings.oFeatures.bServerSide;

Add that variable as the fourth argument to the fnUpdate() call:
oTable.fnUpdate(sCellValue, iRowID, rel, bRefreshTable);

Original comment by dzz.m...@gmail.com on 13 Mar 2013 at 12:20