Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use links with a custom group template and the ngx-gantt-root component? #466

Open
amorelliMooving opened this issue May 14, 2024 · 1 comment

Comments

@amorelliMooving
Copy link

I am using the ngx-gantt-root component to create a Gantt chart with custom group templates. I want to implement links between tasks, but I am having trouble getting the links to display correctly when I select tasks.

`<ngx-gantt-root [sideWidth]="300" >

<ng-template #sideTemplate>
  <div class="gantt-flat-side-header">项目</div>
  <div class="gantt-flat-side-body">
    <div class="gantt-group" *ngFor="let group of groups; trackBy: trackBy">
      <div class="gantt-group-content" [style.height.px]="group.mergedItems?.length! * (styles.lineHeight + 10) - 10">
        {{ group.title }}
      </div>
    </div>
  </div>
</ng-template>

<ng-template #mainTemplate>
  <div class="gantt-main-container">
    
    <!-- groups -->
    <div class="gantt-main-groups" *ngIf="groups && groups.length > 0" [style.width.px]="view.width">
      <ng-container *ngFor="let group of groups; trackBy: trackBy">
        <div class="gantt-main-group" [style.height.px]="group.mergedItems?.length! * (styles.lineHeight + 10) - 10">
         
            <ng-container *ngFor="let items of group.mergedItems">
            <div class="gantt-flat-items" [style.height.px]="styles.lineHeight">
              <ng-container *ngFor="let item of items; trackBy: trackBy">
                <ngx-gantt-bar [item]="item" [template]="barTemplate" (barClick)="barClick.emit($event)"></ngx-gantt-bar>
              </ng-container>
            </div>
          </ng-container>
        </div>
      </ng-container>
    </div>
  </div>
</ng-template>

`

@PRASANTHANTONY12
Copy link

need ts code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants