The Undo functionality is implemented as one of the framework's Subcomponents. It can be used to provide undo support for any component that bears a model.
Currently, the Fluid components that support Undo are:
Component developers must ensure that their component has certain features for Undo to work with it. A component must:
- Bear a model,
- Initialize the Undo decorator if requested.
- is public, i.e. accessible as a member of the component's top-level
The actual contents of a model is, of course, entirely dependent on the component.
To support Undo, a component's model must:
- be called
The component must implement a public function on its
that object called
updateModel() function must update the locally stored model using the
newValue provided. The
source parameter is the subcomponent that triggered the model change.
Initializing the Undo decorator
A component must respond to a user-supplied option requesting Undo by initializing the Undo decorator. This is accomplished by using the
initSubcomponents() framework function:
For more information on subcomponents, see Subcomponents.
The Undo functionality's dependencies can be met by including the minified
InfusionAll.js file in the header of the HTML file:
Alternatively, if you are including individual files, you must include