我在我的一个网站上使用PrimeNG DataTable UI组件。我正在使用行分组功能http://www.primefaces.org/primeng/#/datatable/rowgroup
总的来说,除了胭脂下划线(_)放在每个组标题前面之外,一切都运行良好。例如,使用他们在上面的链接中提供的示例,而不是奥迪,宝马等品牌的分组,它是_Audi,_BMW。
我甚至尝试过复制他们的例子,我仍然会在分组文本前面放置一个下划线。例如:
<p-dataTable [value]="cars1" sortField="brand" rowGroupMode="subheader" groupField="brand" expandableRowGroups="true"
[sortableRowGroup]="false">
<p-header>Toggleable Row Groups with Footers</p-header>
<template pTemplate="rowgroupheader" let-rowData>{{rowData['brand']}}</template>
<p-column field="color" header="Color"></p-column>
<p-column field="year" header="Year"></p-column>
<p-column field="vin" header="Vin"></p-column>
<p-column field="price" header="Price">
<template let-col let-car="rowData" pTemplate="body">
<span>{{car[col.field] | currency:'USD':true:'.0-0'}}</span>
</template>
</p-column>
<template pTemplate="rowgroupfooter" let-car>
<td colspan="3" style="text-align:right">Total Price</td>
<td>{{calculateGroupTotal(car['brand']) | currency:'USD':true:'.0-0' }}</td>
</template>
</p-dataTable>
数据: -
cars1 = [
{ "brand": "VW", "year": 2012, "color": "White", "vin": "dsad231ff" },
{ "brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345" },
{ "brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr" },
{ "brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh" },
{ "brand": "Mercedes", "year": 1995, "color": "White", "vin": "hrtwy34" },
{ "brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj" },
{ "brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr" },
{ "brand": "Jaguar", "year": 2013, "color": "White", "vin": "greg34" },
{ "brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5" },
{ "brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s" }
];
显示
为什么会发生这种情况的任何想法?
答案 0 :(得分:0)