Back to Devexpress

ASPxClientDiagramRequestEditOperationEventArgs.operation Property

aspnet-js-aspxclientdiagramrequesteditoperationeventargs-02cb426f.md

latest5.1 KB
Original Source

ASPxClientDiagramRequestEditOperationEventArgs.operation Property

Identifies the operation currently being processed.

Declaration

ts
operation: DiagramEditOperation

Property Value

TypeDescription
DiagramEditOperation

The operation.

|

Remarks

Use the operation property to determine the operation currently being processed in the RequestEditOperation event.

javascript
function onRequestEditOperation(s, e) {
    if(e.operation === DiagramEditOperation.ResizeShape) {
        if(e.args.newSize.width < 1 || e.args.newSize.height < 0.75) {
            if(e.reason !== DiagramRequestEditOperationReason.CheckUIElementAvailability)
                showWarning("The shape size is too small.");
            e.allowed = false;
        }
    }
    else if(e.operation === DiagramEditOperation.ChangeShapeText) {
        if(e.args.text === "") {
            if(e.reason !== DiagramRequestEditOperationReason.CheckUIElementAvailability)
                showWarning("A shape text cannot be empty.");
            e.allowed = false;
        }
    }
    ...
}

Note that if you want to disable a specific operation type for the entire diagram, you can also set an Allow{Operation} property to false. The table below lists the available operations, their descriptions, and corresponding Allow{Operation} properties.

OperationUser action / IU update operation causes the event to be raisedAllow{Operation} property
AddShapeA user is about to add a shape / The control determines the Paste command’s visibility.AllowAddShape
AddShapeFromToolboxThe control determines the visibility of a shape in the toolbox or context toolbox.AllowAddShape
BeforeChangeConnectorTextA user is about to edit a connector’s text.AllowChangeConnectorText
BeforeChangeShapeTextA user is about to edit a shape’s text.AllowChangeShapeText
ChangeConnectionA user is about to link or delink a connector from a shape / The control determines a connection point’s visibility.AllowChangeConnection
ChangeConnectorPointsA user changed a connector’s points.AllowChangeConnectorPoints
ChangeConnectorTextA user changed a connector’s text.AllowChangeConnectorText
ChangeShapeTextA user changed a shape’s text.AllowChangeShapeText
DeleteConnectorA user is about to delete a connector / The control determines the Cut and Delete commands’ visibility.AllowDeleteConnector
DeleteShapeA user is about to delete a shape / The control determines the visibility of the Cut and Delete commands.AllowDeleteShape
MoveShapeA user moved a shape.AllowMoveShape
ResizeShapeA user resized a shape.AllowResizeShape

The operation property value defines the type of the args property value.

Run Demo: Editing Restrictions

See Also

ASPxClientDiagramRequestEditOperationEventArgs Class

ASPxClientDiagramRequestEditOperationEventArgs Members