Displaying elements of radioList

hi guys,

following code will display elements of radioListe among themseleves(Look at my attachement,please). My intention is to get placed these elements paralell.

Any ideas how to change code?





<div class="col-md-4"><?=

$form->field($model_person, 'id_personentyp_dominant')->radioList([1 => 'Typ Rot', 2 => 'Typ Grün', 3 => 'Typ Blau'], array('labelOptions' => array('style' => 'display:inline'), 'separator' => '  ',

));

 ?></div><div class="col-md-4"><?=

 $form->field($model_person, 'id_personentyp_peripher')->radioList([1 => 'Typ Rot', 2 => 'Typ Grün', 3 => 'Typ Blau'], array('labelOptions' => array('style' => 'display:inline'), 'separator' => '  ',

));

?></div><div class="col-md-4"><?=

$form->field($model_person, 'id_personentyp_defizit')->radioList([1 => 'Typ Rot', 2 => 'Typ Grün', 3 => 'Typ Blau'], array('labelOptions' => array('style' => 'display:inline'), 'separator' => '  ',

));

?></div>




$form->field($model_person, 'id_personentyp_dominant')->radioList([1 => 'Typ Rot', 2 => 'Typ Grün', 3 => 'Typ Blau'], array('labelOptions' => array('style' => 'display:inline'), 'separator' => '  ',

))->inline(true);

Ohhh, it’s yours again I remember yours very well fixing my bugs a lot of time.

Unfortunately, this time, ur suggestion won’t fix my bug. I will get following Exception using inline(true)




yii\base\UnknownMethodException: Calling unknown method: kartik\form\ActiveField::inline() 



Apart from this, I already use




array('labelOptions' => array('style' => 'display:inline'), 'separator' => '  ')



which is ineffective for ActiveForm of kartik, as it seems…

I tried solving problem like this, but didn’t succeed with it

[list=1][]closing ActiveForm before attributes beeing placed paralell[]Defining new ActiveForm as below[]Closing new ActiveForm[]Redefining ActiveForm as usual[/list]





$form = ActiveForm::begin([

            'id' => 'dynamic-form',

            'type' => ActiveForm::TYPE_INLINE,

            'formConfig' => [

                'showLabels' => true

        ]]);



P.S.: This solution is no option,'cause there are too many <div>-tags,which prevent this way!

Thread can be closed…

tklustig

Are you using yii\widgets\ActiveForm;?

I’m work for using yii\bootstrap\ActiveForm;.