基于 rowcell 值的 Kendo-Grid UI 启用/禁用按钮 - Angular

问题描述 投票:0回答:0

我正在使用其中一列中带有下载按钮的 Kendo-Grid。

我想根据行的单元格值启用或禁用按钮。

这是我在 html 中的剑道网格

<kendo-grid [kendoGridBinding]="engagementData" [resizable]="true" [sortable]="true" [pageable]="true" [pageSize]="10">


  <kendo-grid-column field="Engagement" title="Engagement" [width]="150" value="value" [filterable]="true">
    <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
      <kendo-grid-string-filter-cell [column]="column" [filter]="filter">
      </kendo-grid-string-filter-cell>
    </ng-template>
  </kendo-grid-column>

  <kendo-grid-column field="ExtractionStatus" title="Overall Extraction Status" [width]="120">
    <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
      <kendo-grid-string-filter-cell [column]="column" [filter]="filter">
      </kendo-grid-string-filter-cell>
    </ng-template>
  </kendo-grid-column>

  <kendo-grid-column field="ExtractionStatus" title="Action" [width]="120" value="value" [filterable]="false">
    <ng-template kendoGridCellTemplate let-dataItem="dataItem" let-rowIndex="rowIndex">
      <strong><button  (click) = "parentDownloadClick()" style="color: #007bff;cursor: pointer;" [disabled] = "engagementData.ExtractionStatus == 'In Progress'">Download</button></strong>
    </ng-template>
  </kendo-grid-column>
我正在使用下面的代码来禁用按钮

[disabled] = "engagementData.ExtractionStatus == 'In Progress'"

但是我得到一个编译错误

'Property 'ExtractionStatus' does not exist on type 'ItransactionDetails[]''

这是我的 ITransactionDetails 的样子,它是 engagementData 的数据类型。

export interface ItransactionDetails {
  TransactionID: string;
  Engagement: string;
  ExtractionStatus: string;
  }

如何读取单元格值以禁用/启用按钮?

或者有更好的方法吗?

有人可以帮我解决我可能遗漏的问题吗?

angular kendo-ui kendo-grid kendo-ui-angular2 kendo-ui-grid
© www.soinside.com 2019 - 2024. All rights reserved.