代码链接为:https ://plnkr.co/edit/V9ZkLzDeVo15ngIu2Glo?p=preview
我的模板是:
<p-dataTable [value]="cars">
<p-headerColumnGroup>
<p-row>
<p-column header="Vin" rowspan="2" [sortable]="true"></p-column>
<p-column header="Info" colspan="3"></p-column>
</p-row>
<p-row>
<p-column header="Year" [sortable]="true"></p-column>
<p-column header="Brand" [sortable]="true"></p-column>
<p-column header="Color" [sortable]="true"></p-column>
</p-row>
</p-headerColumnGroup>
<p-column field="vin"></p-column>
<p-column field="year"></p-column>
<p-column field="brand"></p-column>
<p-column field="color"></p-column>
当有 colgroup 标头时,排序功能将不起作用。有人可以建议我吗?