我正在使用 Infragistics grid 。我有几列,我正在尝试访问最后一列中第一列的值。
我在 IgxColumnComponent
中创建了一个变量,但是当我从另一个 IgxColumnComponent
访问它时,我得到了 [object][object]
对象如下所示
<igx-column #docid field="documentId" header="Document Id" [filterable]="true" dataType="string" style="font-size:20px">
</igx-column>
<igx-column field="source" header="Source" [filterable]="true" dataType="string" style="font-size:10px">
<ng-template igxCell let-cell="cell">
<div *ngIf="cell.value==2">
<span>
{{docid}}
<img src="../../assets/icons/po-ack-Icon.png" />
</span>
</div>
</ng-template>
</igx-column>
最佳答案
可以从 IgxCell
的 rowData
访问另一个 IgxColumnComponent
的字段值
属性:
<igx-column field="source"header="Source" [filterable]="true"
dataType="string" style="font-size:10px">
<ng-template igxCell let-cell="cell">
<div *ngIf="cell.rowData.DocumentId==2">
<span>
{{cell.rowData.DocumentId}}
</span>
</div>
</ng-template>
</igx-column>
这是一个stackblitz sample这证明了这一点。
此外,Infragistics 文档 here 中列出了 IgxCell
的所有属性。有关 IgxColumnComponent
的更多信息,请参阅 here .
关于angular - 如何将一个 Igx 列值放入另一列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65509670/