0

I use TbGridView and class TbEditableColumn to edit elements TbGridView once, but I have a problem - values for TbEditableColumn can't be with font awesome icons. How to make TbEditableColumn value is taken for font awesome?

Example:

array(
                'class' => 'booster.widgets.TbEditableColumn',
                'name' => 'pictogram',
                'sortable' => true,
                'editable' => array(
                    'url' => $this->createUrl('/currencyAjax/update'),
                    'placement' => 'right',
                    'inputclass' => 'span3',
                    'title' => 'Currency',
                    'type' => 'select',
                    'source' => Currency::getPictograms(),
                )
            ),

And Currency::getPictograms() like this:

public static $currencyPictograms = array(
        'glyphicon fa fa-usd' => '<span class="glyphicon fa fa-usd"></span>',
        'glyphicon fa fa-jpy' => '<span class="glyphicon fa fa-jpy"></span>',
        'glyphicon fa fa-eur' => '<span class="glyphicon fa fa-eur"></span>',
        'glyphicon fa fa-rub' => '<span class="glyphicon fa fa-rub"></span>',
    );
public static function getPictograms(){
        return self::$currencyPictograms;
    }

In result I have:

    <select class="form-control span3">
<option value="glyphicon fa fa-usd">&lt;span class=&quot;glyphicon fa fa-usd&quot;&gt;&lt;/span&gt;</option>
<option value="glyphicon fa fa-jpy">&lt;span class=&quot;glyphicon fa fa-jpy&quot;&gt;&lt;/span&gt;</option>
<option value="glyphicon fa fa-eur">&lt;span class=&quot;glyphicon fa fa-eur&quot;&gt;&lt;/span&gt;</option>
<option value="glyphicon fa fa-rub">&lt;span class=&quot;glyphicon fa fa-rub&quot;&gt;&lt;/span&gt;</option>
</select>

Any ideas?

1 Answers1

0
array(
            'class' => 'booster.widgets.TbEditableColumn',
            'name' => 'pictogram',
            'sortable' => true,
            'editable' => array(
                'url' => $this->createUrl('/currencyAjax/update'),
                'placement' => 'right',
                'inputclass' => 'span3',
                'title' => 'Currency',
                'type' => 'select',
                'source' => Currency::getPictograms(),
                'encode' => false, // <= this flag should turn off html encoding
            )
        ),

More info on: http://ybe.demopage.ru/#EditableColumn

Tomasz Szuba
  • 441
  • 4
  • 9