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([
      ‘model’=>$model,
          ‘form’=>$form,
            ‘columns’=>5,
              ‘attributes’=>[
                     ‘myfield’=>[
                        
                            ‘type’=>Form::INPUT_WIDGET,
                            ‘widgetClass’=>’\kartik\widgets\Select2’,
                            ‘options’=>[
                                ‘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