angular primeng 的table组件在设置了selection属性和p-tableRadioButton后怎么让控制table在选中时某些列无法选中
可以通过在
例如,如果要让表格中的第一列不可选中,可以在
<p-table [value]="data" [(selection)]="selectedItems">
<ng-template pTemplate="header">
<tr>
<th style="width: 20px"></th>
<th>Name</th>
<th>Age</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-item>
<tr>
<td><p-tableRadioButton [value]="item"></p-tableRadioButton></td>
<td>{{item.name}}</td>
<td>{{item.age}}</td>
</tr>
</ng-template>
<p-tableColumn selectionMode="none"></p-tableColumn>
</p-table>
在上面的代码中,我们在
原文地址: https://www.cveoy.top/t/topic/bo1e 著作权归作者所有。请勿转载和采集!