Search code examples
phpyiiyii-extensionsyii2

kartik-v Editable::INPUT_RADIO showing only one radio button on edit


I am using kartik-v Editable plugin in yii2 however i cannot found any working example of Editable::INPUT_RADIO. i used following code but it is not working.

<?= Editable::widget([
    'name'=>'gender', 
    'asPopover' => false,
    'value' => 'male',
    'header' => 'Name',
    'inputType' => Editable::INPUT_RADIO,
    'data' => ['male' => 'Male', 'female' => 'Female'],
    'options' => ['class'=>'form-control'],
    'displayValueConfig'=> ['male' => 'Male', 'female' => 'Female'],
  ]); ?>

when i click to edit it displays only one radio button and no label.


Solution

  • I found the answer. i was using wrong value for inputType attribute i replaced Editable::INPUT_RADIO with Editable::INPUT_RADIO_LIST and now it is working.