I have prime ng table having 2 columns one is for radio button and the other is for name.I just want to select the radio button if click anywhere on the row.Thanks in advance.
1 Answer
You don't need any script for this - if you associate the text with the input using a label, this works out of the box... in the example below you can click on the radio, or the "Radio Button Label".
<div>
<label for="test">Radio Button Label</label>
</div>
<div>
<input type="radio" id="test" name="test" />
</div>
2 Comments
Abhijeet Choudhari
Actually we did not have label for the radio button So I used <input type="radio" name="selectRoom" [checked]="rowIndex === checked" (change)="setSelectedRoomData(rowData,rowIndex)" />
Kamil Naja
So wrap this inside empty label element :) Fenton method works very good