Yii Framework Forum: How to render html tags in tooltip? - Yii Framework Forum

Jump to content

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

How to render html tags in tooltip? [canceled]

#1 User is offline   tklustig 

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

Posted 23 February 2018 - 09:04 AM

Hi guys, following code will show me tooltip in GridView. Unfortunately, I have no idea how to render html tags inside it,. As content comes from database, there will be no rendering of any html tags. Tags will be shown as tags without execute them. Ideas, how to render html tags inside tooltips?
.
.
    [
        'attribute' => $dummy,
        'label' => Yii::t('app', 'Charakterisierung'),
        'format' => 'html',
        'vAlign' => 'middle',
        'value' => function($model) {
            if (!(empty($model->person->personentypDominant->typ_name))) {
                $tag = Html::tag('span', 'Tooltip-Touch Me!', [
                            // html-tags won't be rendered in title
                            'title' => $model->person->personentypDominant->typ_empfehlung,],
                            'data-placement' => 'left',
                            'style' => 'white-space:pre;border:1px solid red;'
                ]);
                return $tag . "<br>" . $model->person->personentypDominant->typ_verhaltensmerkmal_im_team_1 . "," . $model->person->personentypDominant->typ_verhaltensmerkmal_bei_stress_3 . "," . $model->person->personentypDominant->typ_verhaltensmerkmal_am_arbeitsplatz_4;
            }
        }
    ],
.
.

0

#2 User is offline   Menapro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 27-October 16
  • Location:Burgos, Spain

Posted 24 February 2018 - 07:36 PM

It is impossible to add nested html tags inside a tag attribute.
0

#3 User is offline   tklustig 

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

Posted 25 February 2018 - 10:15 AM

 Menapro, on 24 February 2018 - 07:36 PM, said:

It is impossible to add nested html tags inside a tag attribute.

Impossible?
How to create tooltips in a way my intention will be achieved?
If it's actually impossible, I need another way creating tooltips. Any ideas?



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