onUndo

fires when undo/redo operations are performed

void onUndo(string|object action,number|object row,number|object column,any value,boolean dir,object extra);
actionstring|objectthe name of the action that is undone or redone
rownumber|objectthe row id
columnnumber|objectthe column id
valueanythe value to restore
dirbooleanfalse - undo, true - redo
extraobjectany additional info

Example

webix.ui({
  view:"spreadsheet",
  toolbar:"full",
  data:spreadsheet_data,
  on:{
    onUndo(action, row, column, value, dir, extra){
      if(action == "paste"){
        // do something
      } else if(action == "grid-change"){ // add or remove row/col
        // do something
      }
    },
  }
});

Details

For hiding and showing rows or columns, the parameters have the following values:

  • action - an object like { id:"hide", group:"row" }
  • row - for row operations, an object with the start and end rows: { start:{ row }, end:{ row } }
  • column - for column operations, an object with the start and end columns: { start:{ column }, end:{ column } }

The value parameter contains the previous value for undo and the new value for redo.

Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.