Yii Framework Forum: Displaying elements of radioList - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Displaying elements of radioList [canceled]

#1 User is offline   tklustig 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 419
  • Joined: 20-April 17
  • Location:Hannover

Posted 02 March 2018 - 12:01 PM

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>

Attached File(s)


0

#2 User is offline   umneeq 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 206
  • Joined: 10-October 11
  • Location:Russia

Posted 02 March 2018 - 03:46 PM

$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);

0

#3 User is offline   tklustig 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 419
  • Joined: 20-April 17
  • Location:Hannover

Posted 02 March 2018 - 04:44 PM

View Postumneeq, on 02 March 2018 - 03:46 PM, said:

$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 againPosted Image 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...
0

#4 User is offline   tklustig 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 419
  • Joined: 20-April 17
  • Location:Hannover

Posted 02 March 2018 - 05:15 PM

I tried solving problem like this, but didn't succeed with it
  • closing ActiveForm before attributes beeing placed paralell
  • Defining new ActiveForm as below
  • Closing new ActiveForm
  • Redefining ActiveForm as usual


$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...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users