0

をに設定しようとしPuiRadioButtoncheckedいますが、問題が発生しました。基礎となる純粋な HTML 入力要素が選択されますが、PrimeUI には変更が表示されません。

私は2つの要素を持っています:

<input type="radio" name="peopleSelection" id="peopleRadioButton" value="people" checked="checked" />

<input type="radio" name="peopleSelection" id="groupRadioButton" value="group" />

そして、私は次のステートメントを試しました

$('#groupRadioButton').attr('checked', 'checked');

JSFiddle で完全に正常に動作します。しかし、HTML を検査すると、正しい入力要素が正常にチェックされますが、PrimeUI には表示されません。

これらのバリエーションも試しました:

$('#groupRadioButton').prop('checked', true);
$('#groupRadioButton').attr('checked', 'checked');
$('#groupRadioButton')[0].checked = true;

残念ながら、 PrimeUi ドキュメントページでsetorgetメソッドを見つけることができませんでした。

PrimeUI のラジオ ボタンを選択/選択解除するにはどうすればよいですか?

前もって感謝します

4

0 に答える 0