Ramco Ramco

Ramco Ramco

  • 444
  • 3.1k
  • 435.1k

Edit Delete buttons are not getting displayed

Jun 27 2024 4:29 AM

Hi

  I am passing below data to Child Component but action buttons are not getting displayed when Column Title = 'options'

this.columns = [
      { title: "Type", name: "name" , visible: true },      
      { title: "Description", name: "description" , visible: true },      
     
      {
        title: "Action",
        name: 'actions',
        visible: true,
        buttons: this._common.getActionButton(this.btnEditClick,this.btnDeleteClick,Function())           
      }
    ]

*********************
<table mat-table [dataSource]="dataSource" class="w-100" matSort (matSortChange)="sortData($event)"
            *ngIf="!isLoading">
            <ng-container *ngFor="let item of columns">
              <ng-container [matColumnDef]="item.name">
                <th mat-header-cell *matHeaderCellDef>{{ item.name }}</th> 
                <td mat-cell *matCellDef="let element">{{ element[item.name] }}</td>
              </ng-container>
              <ng-container *ngIf="item.name === 'actions'">
                <span mat-icon-button *ngFor="let actionButton of item.buttons"
                   class="btn">
                </span>
              </ng-container>
            </ng-container>

Thanks


Answers (1)