How add tooltip to options select2?

Web Tips Q & ACategory: Krajee Yii2 ExtensionsHow add tooltip to options select2?
Zrue asked 1 month ago

Hello friends
I’m trying to add tooltip to options select2, but not work:

  echo Form::widget([
                                ‘data’=>[1 => ‘No’,2 => ‘Yes’,],
                                ‘pluginEvents’ => [
                                         “select2:open” => ‘function() {  $(“li.select2-results__option”).tooltip();}’,                               
                                ‘options’ => [
                                    ‘placeholder’ => ‘Select …’,
                                    ‘options’ => [
                                        1=>[‘data-toggle’=>’tooltip’,’title’=>’info NO’],
                                        2=>[‘data-toggle’=>’tooltip’,’title’=>’info YES’]],
Can you help me?. Thank you.

Login or register to contribute or comment.

Login   Register