在我的
Kendo UI Grid
cell template
,我尝试显示图像(如果存在)或显示客户的缩写。
<kendo-grid-column>
<ng-template kendoGridCellTemplate let-dataItem>
<i class="circle" style="background: #b5b2ad; display: inline-flex; height: 30px; width: 30px;
border-radius: 50%; border: white; border-style: solid; border-width: 1px;">
<span style="margin: 6px 0 0 5px; color: #000;font: 14px Arial;">
{{ getCustomerInitials(dataItem) }}
</span>
<img [hidden]="noImage" src="{{ './assets/profiles/customer/' + dataItem.CustomerID + '.jpg' }}"
(error)="noImage=true"
height="30" width="30" style="border-radius:30px;"/>
</i>
</ng-template>
</kendo-grid-column>
我用的是img的角度等价物
onrrror
<img [hidden]="noImage" (error)="noImage=true" src... />
不过,我相信它已经定下来了
hidden
每个记录都是真的。