ejbeaty/CellEdit

Undo

Opened this issue · 1 comments

Hi,

How can I do or some example related to undo or redo?

You can use the oldValue param passed to the onUpdate callback.

Example

myTable.MakeCellsEditable({
    onUpdate: onMyTableUpdated,
    ...
});

function onMyTableUpdated(updatedCell, updatedRow, oldValue) {
    if (newRow[0] > 5) {
        alert('Bad value');
        updatedCell.data(oldValue); // Undo
        return false;
    } else {
        // Ajax for instance
    }
}