New to KendoReact? Start a free 30-day trial

Undo-redo service.

Definition

Package:@progress/kendo-react-diagram

Properties

Configuration options for the observable instance.

Methods

Standard addition of a unit. See also the batch version; begin-addCompositeUnit-commit methods.

Parameters:undoUnitany

The unit to be added.

execute?boolean

If false, the unit will be added but not executed.

Adds a unit as part of the begin-commit batch.

Parameters:undoUnitany

Starts the collection of units. Add those with the addCompositeItem method and call commit. Or cancel to forget about it.

Binds event handlers to one or more events.

Parameters:eventEventNames | { [key: string]: Handler }

The event name(s) to bind to, or an object mapping event names to handlers

handlers?EventHandlers

The event handler(s) to bind. Can be a function or an object mapping event names to handlers

one?boolean

If true, the handler will be executed only once and then automatically unbound

Returns:

this

The Observable instance for method chaining

Cancels the collection process of unit started with 'begin'.

Clears the stack.

Commits a batch of units.

Parameters:execute?boolean

Gets the number of undoable units in the stack.

Returns:

number

The number of undoable units.

Destroys the observable instance and removes all event handlers. This method should be called when the observable is no longer needed to prevent memory leaks.

Binds event handlers to be executed first (prepends to the handlers list). These handlers will be called before any previously bound handlers for the same event.

Parameters:eventNameEventNames

The event name(s) to bind to

handlersEventHandlers

The event handler(s) to bind

Returns:

this

The Observable instance for method chaining

Binds event handlers that will be executed only once. After execution, the handlers are automatically unbound.

Parameters:eventNamesEventNames

The event name(s) to bind to

handlersEventHandlers

The event handler(s) to bind

Returns:

this

The Observable instance for method chaining

Redo of the last undone action.

Triggers an event, calling all bound handlers for that event.

Parameters:eventNamestring

The name of the event to trigger

eventArgs?any

Optional event arguments to pass to the handlers

Returns:

boolean

True if any handler called preventDefault(), false otherwise

Removes event handlers from events.

Parameters:eventName?string

The event name to unbind from. If undefined, all events are unbound

handler?EventHandlers

The specific handler to remove. If undefined, all handlers for the event are removed

Returns:

this

The Observable instance for method chaining

Rollback of the unit on top of the stack.