1

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
  • There is various primeng table versions ! Could you add code sample? Commented Nov 23, 2018 at 9:50

1 Answer 1

3

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>
Sign up to request clarification or add additional context in comments.

2 Comments

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)" />
So wrap this inside empty label element :) Fenton method works very good

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.