Using checkbox selection and row selection together in PrimeNg table

@Arun's answer is correct. I'm just adding some formatting if someone also stumbles on this problem and is short of time ;) :

<ng-template pTemplate="body" let-data>
    <tr [pSelectableRow]="data">
       <td>
          <p-tableCheckbox [pSelectableRow]="data" [value]="data"></p-tableCheckbox>
       </td>
    </tr>
</ng-template>

It also works well without providing [index] to the tableCheckbox.


Yes R.Richards is right adding dataKey should resolve the problem. But still without dataKey just add this <p-tableCheckbox [value]="row" [pSelectableRow]="row"></p-tableCheckbox>with your row checkbox. This should work as I remember I had done something like this earlier with my code:)