2

How to set Dropdown list width in Yii2, here the code

<?= $form->field($model, 'id_ts')
    ->dropDownList( 
        ArrayHelper::map(vision::find()->all(),'id_ts', 'vision'),
        [ 
            'prompt' =>'',
            'disabled' => $model->isNewRecord ? true : false 
        ]
    ) ?>

How to make dropdown list box wider ?

0

1 Answer 1

2

You can just add style in dropDownList show below code

<?= $form
  ->field($model, 'id_ts')
  ->dropDownList( 
    ArrayHelper::map(vision::find()->all(),'id_ts', 'vision'), 
    [
        'style' => 'width:15px !important', 
        'prompt' => '', 
        'disabled' => $model->isNewRecord ? true : false 
    ]
  ) ?>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.