hussainesmail / jquery-datatables-editable

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

fnOnEdited should have access to aPos #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I did this, as a result of a) getting error alerts while using ajax, despite 
the fact the insert was working, and b) because on updates, I wanted to call 
fnUpdate so that I could update the row with the new value if the insert is 
successful...so I commented out the fnshowerror on the update, which still 
displays if the insert to the db is unsuccessful, but then I added aPos to the 
variables that get passed to fnOnEdited, so I can do "oTable.fnUpdate(newval, 
aPos[0], aPos[2]);" to update the row and not have to reload the whole 
table.... my edits below, starting around line 154 of 
jquery.dataTables.editable.js:

         } else {
                        var aPos = oTable.fnGetPosition(this);
                        oTable.fnUpdate(sOldValue, aPos[0], aPos[2]);
                        //properties.fnShowError(sValue, "update");
                        status = "failure";
                    }

                    properties.fnOnEdited(status, aPos, sOldValue, sNewCellDisplayValue, aPos[0], aPos[1], aPos[2]);
                    if (settings.fnOnCellUpdated != null) {
                        settings.fnOnCellUpdated(status, sValue, settings);
                    }

Original issue reported on code.google.com by mparn...@gmail.com on 16 Nov 2011 at 7:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'm an idiot, I forgot to have the edit script return the value. Apologies.

Original comment by mparn...@gmail.com on 17 Nov 2011 at 3:08

GoogleCodeExporter commented 9 years ago

Original comment by joc...@gmail.com on 9 Feb 2012 at 9:50