Disabling Lane Headers Editing in Syncfusion ejs-diagram (SwimLane) with Angular 18


I am currently using the ejs-diagram component with the type: 'SwimLane' in an Angular 18 project. I would like to disable editing on the Lane headers.

I have reviewed the documentation but could not find a solution for this specific requirement. I also attempted to apply constraints: AnnotationConstraints.ReadOnly, but it did not achieve the desired result.

Could you kindly advise if there is a way to disable editing on Lane headers? I would greatly appreciate your assistance and any guidance you can provide.

Thank you in advance for your support!

Best regards,


Image_9571_1733972914477


<ejs-diagram #diagram id="diagram" width="100%" height="475px"
                                [snapSettings]='snapSettings'

                                [getConnectorDefaults]='getConnectorDefaults'
                                [getNodeDefaults]='getNodeDefaults'
                                [tooltip]='tooltip'
                                [tool]='tool'
                                [selectedItems]='selectedItems'
                                [contextMenuSettings]='contextMenuSettings'
                                (contextMenuOpen)='contextMenuOpen($event)'
                                (contextMenuClick)='contextMenuClick($event)'
                                (created)="created()"
                                (doubleClick)="getDoubleClick($event)"
                                (click)="getDetailClick($event)"
                                (positionChange)="onDragEnter($event)"
                                [commandManager]="commandManager"
                              >
                    </ejs-diagram>


  generateLanes(): LaneModel[] {
    let lanes: any[] = [];
    lanes = this.decKeys.map((key, index) => ({
      id: `stackCanvas${index}`,
      header: {
        annotation: {
          content:
            key == null ? '' : key.length > this.headerTextLength ? key.slice(0, this.headerTextLength) + '...' : key,
          addInfo: {
            value: key == null ? '' : `${key} [${this.utils.titleCase(this.decKeyTypes[index])}]`,
            description: this.decKeyDescriptions[index],
          },
          constraints: AnnotationConstraints.ReadOnly,
        },
        addInfo: { value: key == null ? '' : key },
        width: 50,
        style: {
          fontSize: 11,
          fill: 'transparent',
        },
      },
      height: 100,
      children: this.generateChildrenNodes(index),
      canMove: false,
    })) as LaneModel[];

    // generate last static Assignment lane
    lanes.push({
      id: `stackCanvas${lanes.length}`,
      header: {
        annotation: {
          content: 'Assignment',
          addInfo: {
            value: 'Assignment',
          },
          constraints: AnnotationConstraints.ReadOnly,
        },
        width: 50,
        style: { fontSize: 11, fill: '#BDB76B' },
      },
      height: 100,
      children: this.generateAssignmentNodes(lanes.length),
      canMove: false,
    });

    return lanes;
  }



3 Replies

MG Moulidharan Gopalakrishnan Syncfusion Team December 12, 2024 09:39 AM UTC

Hi,

Based on the provided code snippet, to disable the editing of the lane header, we need to set the annotation constraints to AnnotationConstraints.ReadOnly. We are unclear about your scenario and how to replicate the issue you're facing as its working fine When defining the lane at initial rendering and adding lanes at runtime, the annotation remains disabled from editing.

 

Please provide a reproducible sample of the issue or modify the provided sample to help us better understand the problem.

Sample: 7diu7pq5 (forked) - StackBlitz

 

 

Regards,

Moulidharan G 




PS P. S. replied to Moulidharan Gopalakrishnan December 16, 2024 11:10 AM UTC

Hello,
I’ve already mocked up the component using the sample below. But for some reason, the lane header isn’t enabled like it is in my local project.

Sample: stackblitz


PS. I am using "@syncfusion/ej2": "^26.2.10",



DP Dhakshin Prasath Dhanraj Syncfusion Team December 17, 2024 12:57 PM UTC

Hi,
To disable interaction with lane header, you need to set the annotations constraint to "AnnotationConstraints.ReadOnly". To enable interaction on lane header, you can remove the "AnnotationConstraints.ReadOnly" annotation constraints.
 In your sample, you have disabled annotation interaction by setting AnnotationConstraints.ReadOnly". Please let us know if you need further assistance.

Regards,

Dhakshin D


Loader.
Up arrow icon