UndoRedo
A widget which encapsulates undo/redo functionality for the project of a scheduling widget (Scheduler, Gantt or Calendar).
To make use of this, the project must be configured with a State Tracking Manager.
Note that this widget will automatically enable the stm instance, upon the load event of the project's crud manager.
If inserted into a scheduling widget (such as into a tbar, or bbar, or as an item in a context menu), the project of the encapsulating scheduling widget will be used.
If this widget is to be used "standalone" (rendered into the DOM outside of a scheduling widget), this must be configured with a reference to the project, or the scheduling widget which is using the project. This can be done with the project and scheduler config options correspondingly.
There are three child widgets encapsulated which may be referenced through the widgetMap:
undoBtn- The button which operates the undo operation (CTRL+Z, or CMD+Z in Mac OS)transactionsCombo- A combobox into which is pushed the list of transactions,redoBtn- The button which operates the redo operation (CTRL+SHIFT+Z, + CMD+SHIFT+Z in Mac OS)
To disable keyboard shortcuts for undo/redo, set enableUndoRedoKeys to false.
The transactionsCombo may be configured away if only the buttons are required:
{
type : 'undoredo',
items : {
transactionsCombo : null
}
}
The example below illustrated how to embed an undoredo widget in the top toolbar of a Scheduler.
See also
- UndoRedoBase - Base undo/redo widget
- StateTrackingManager - STM engine
- ProjectModel - Project data model
Configs
Configs are options you supply in a configuration object when creating an instance of this classProperties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of UndoRedo class, or subclass thereof.