我想知道如何将超链接添加到igx网格中的单个列中?以下是一个示例数据:
export const DATA: any[] = [
{
OrderID: 10524,
SaleAmount: 3192.65,
CategoryName: "Beverages",
CompanyName: "Berglunds snabbköp",
ShipCountry: "France",
ShippedDate: new Date("1997-05-07T00:00:00Z"),
Website: "https://www.infragistics.com/"
},
{
OrderID: 10511,
SaleAmount: 2550.0,
CategoryName: "Beverages",
CompanyName: "Bon app'",
ShipCountry: "France",
ShippedDate: new Date("1997-04-21T00:00:00Z"),
Website: "https://www.google.com/"
},
]
发布于 2021-03-05 08:59:05
超链接可以通过使用igxCell添加到单元模板中
<igx-column field="Website" header="Website" [dataType]="'string'" [minWidth]='"200px"'>
<ng-template igxCell let-cell="cell">
<a class="truncate" href="{{cell.value}}" target="_blank">{{cell.value}}</a>
</ng-template>
</igx-column>
这里您可以找到一个stackblitz示例,演示如何实现所需的行为。
此外,所有IgxCell的属性都列在了这里的文档中,有关IgxColumnComponent的更多信息可以在这里中找到。
https://stackoverflow.com/questions/66493005
复制相似问题