簡體   English   中英

使用TbHtml的TbEdiableColumn中的用法圖標

[英]Usage icons in TbEdiableColumn with TbHtml

我使用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>

有任何想法嗎?

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

有關更多信息:http: //ybe.demopage.ru/#EditableColumn

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM