0

我使用 TbGridView 和 TbEditableColumn 类来编辑元素 TbGridView 一次,但我有一个问题 - TbEditableColumn 的值不能与字体真棒图标一起使用。如何使 TbEditableColumn 值被用于字体真棒?

例子:

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(),
                )
            ),

和 Currency::getPictograms() 像这样:

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;
    }

结果我有:

    <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>

有任何想法吗?

4

1 回答 1

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

于 2015-02-10T15:21:02.940 回答