yii2 bootstrap for jui widgets

Is it possible to render the yii2 jui/autocomplete widget in a bootstrap theme ?

Doesn’t this http://www.yiiframework.com/doc-2.0/yii-jui-autocomplete.html render jui autocomplete with Bootstrap?

You can always use http://www.yiiframework.com/extension/yii2-ajaxdropdown extension made especially for Bootstrap.

I implemented based on the first link. It works but does not render bootstrap style. Is there a way I can set bootstrap style at the global style level to override the default style (including jui widgets) as opposed to using the bootstrap widgets ?

I guess you can always add some bootstrap classes to the widget with the ‘options’ parameter (i.e. ‘form-control’) but I’m not sure if you can modify html of the “suggestion strips”.

This reply is just for anyone who is looking for the same answer.

You could specify class by specifying option attribute of AutoComplete widget.




$form->field($person, 'name')->widget(AutoComplete::className(), [

        'model' => $person,

        'attribute' => 'name',

        'clientOptions' => [

            'source' => Url::toRoute(['controller/action']),

        ],

        'options' => ['class' => 'form-control'],

    ]);