Skip to main content
All docs
V24.2

DiagramShape.attachedConnectorIds Property

Gets an array of attached connector identifiers.

Declaration

attachedConnectorIds: string[]

Property Value

Type Description
string[]

An array of attached connector identifiers.

Remarks

if(e.operation === DiagramEditOperation.DeleteShape) {
  if(e.args.shape.type === "team") {
    for(var i = 0; i < e.args.shape.attachedConnectorIds.length; i++) {
      if(s.GetItemById(e.args.shape.attachedConnectorIds[i]).toId != e.args.shape.id) {
        if(e.reason !== DiagramRequestEditOperationReason.CheckUIElementAvailability)
          showWarning("You cannot delete a 'Team' shape that has a child shape.");
        e.allowed = false;
        break;
      }
    }
  }
}

Run Demo: Editing Restrictions

When a user pastes or clones several items in a diagram, the control adds the items to the model one by one. For each added item, the RequestEditOperation event fires. In the event handler, you can access the processed item. However, if you call the GetItemById(id) method to access an attached connector, you can get the undefinedresult if the item is not added to the model yet.

See Also