Back to Devexpress

ASPxClientDiagramRequestEditOperationEventArgs.allowed Property

aspnet-js-aspxclientdiagramrequesteditoperationeventargs.md

latest1.4 KB
Original Source

ASPxClientDiagramRequestEditOperationEventArgs.allowed Property

Specifies whether the edit operation is allowed.

Declaration

ts
allowed: boolean

Property Value

TypeDescription
boolean

true to allow the operation to be processed; otherwise, false.
Default value: true

|

Remarks

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;
        }
    }
    ...
}

Run Demo: Editing Restrictions

See Also

ASPxClientDiagramRequestEditOperationEventArgs Class

ASPxClientDiagramRequestEditOperationEventArgs Members