当列附加了模板时,DataTableRowExpander 不起作用。请参阅下面的代码以供参考。
<p-dataTable [value]="projects" expandableRows="true">
<p-column expander="true" style="width:22px"></p-column>
<p-column field="projectState" [sortable]="true" header="Status"></p-column>
<p-column field="bid" header="BU" [sortable]="true">
<template #col #project="rowData" class="col-md-1">
{{GetBU(project[col.field])}}
</template>
</p-column>
<template #project >
<div class="ui-grid ui-grid-responsive ui-fluid" style="font-size:16px;padding:20px">
<div class="ui-grid-row">
<div class="ui-grid-col-9">
<div class="ui-grid ui-grid-responsive ui-grid-pad">
<div class="ui-grid-row">
<div class="ui-grid-col-2 label">Vin: </div>
<div class="ui-grid-col-10">{{project.projectState}}</div>
</div>
</div>
</div>
</div>
</div>
</template>
</p-dataTable>