下面是我的代码,它以'Yes'
或'No'
的形式获取序列号,当值为disable
时我想按'No'
按钮
{
headerName: this.translate.instant("sutk.inventory.grid.partNumberView.isSerialized"),
field: "isSerialized",
cellRendererFramework: LinkRendererComponent,
cellRendererFrameworkParams: {
onClick: (data: any) => {
this.fetchSerialNumbers(data.itemLocation.inventoryId, 'Inventory');
}
}
}
这是我的单元格渲染:
agInit(params: any): void {
this.params = params;
if (this.params.colDef.cellRendererFrameworkParams && this.params.colDef.cellRendererFrameworkParams.onClick) {
this.parentOnClick = this.params.colDef.cellRendererFrameworkParams.onClick;
}
this.text = eval("params.data." + params.colDef.field);
}
答案 0 :(得分:0)
您发布的代码与您的问题确实不符。
要禁用基于变量值的按钮,您的模板应如下所示:
<button [disabled]="!isEnabled">Custom Button</button>