我使用 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"><span class="glyphicon fa fa-usd"></span></option>
<option value="glyphicon fa fa-jpy"><span class="glyphicon fa fa-jpy"></span></option>
<option value="glyphicon fa fa-eur"><span class="glyphicon fa fa-eur"></span></option>
<option value="glyphicon fa fa-rub"><span class="glyphicon fa fa-rub"></span></option>
</select>
有任何想法吗?