aspnet-js-aspxclientdiagramrequesteditoperationeventargs-b15c3034.md
Identifies the reason why the event is raised.
reason: DiagramRequestEditOperationReason
| Type | Description |
|---|---|
| DiagramRequestEditOperationReason |
A value that identifies the reason.
|
The RequestEditOperation event fires to request information about edit operation availability. The reason event parameter identifies why the control requires this information.
The CheckUIElementAvailability value indicates that the control is updating the UI. Set the allowed property to false to hide the UI element associated with the specified operation.
The ModelModification value indicates if a user attempts an edit operation. You can specify whether to allow the operation and display an error message if a user tries to execute a prohibited action.
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("The shape text cannot be empty.");
e.allowed = false;
}
}
...
}
Run Demo: Editing Restrictions
See Also