Глиф Icomoon в столбце действий Extjs групповой сетки не работает?

У меня проблема с отображением глифа icomoon в столбцах действий сетки с использованием sencha architect в приложении extjs 5.0. Здесь я использую групповую сетку. Кстати, глифы хорошо отображаются на любой внешней кнопке.

Я создал класс перезаписи для Ext.grid.column.Action, как показано в следующей ссылке as

Ext.define('MyApp.override.grid.column.Action', {
    override: 'Ext.grid.column.Action',
    // overridden to implement
    defaultRenderer: function(v, cellValues, record, rowIdx, colIdx, store, view) {
        var me = this,
            prefix = Ext.baseCSSPrefix,
            scope = me.origScope || me,
            items = me.items,
            len = items.length,
            i = 0,
            item, ret, disabled, tooltip,glyph, glyphParts, glyphFontFamily;

        // Allow a configured renderer to create initial value (And set the other values in the "metadata" argument!)
        // Assign a new variable here, since if we modify "v" it will also modify the arguments collection, meaning
        // we will pass an incorrect value to getClass/getTip
        ret = Ext.isFunction(me.origRenderer) ? me.origRenderer.apply(scope, arguments) || '' : '';

        cellValues.tdCls += ' ' + Ext.baseCSSPrefix + 'action-col-cell';
        for (; i < len; i++) {
            item = items[i];

            disabled = item.disabled || (item.isDisabled ? item.isDisabled.call(item.scope || scope, view, rowIdx, colIdx, item, record) : false);
            tooltip = disabled ? null : (item.tooltip || (item.getTip ? item.getTip.apply(item.scope || scope, arguments) : null));
            if(Ext.isFunction(item.getGlyph)){
                glyph = item.getGlyph.apply(item.scope || scope, arguments);
            }else{
                glyph = item.glyph;
            }

            // Only process the item action setup once.
            if (!item.hasActionConfiguration) {
                // Apply our documented default to all items
                item.stopSelection = me.stopSelection;
                item.disable = Ext.Function.bind(me.disableAction, me, [i], 0);
                item.enable = Ext.Function.bind(me.enableAction, me, [i], 0);
                item.hasActionConfiguration = true;
            }
            if (glyph ) {

                if (typeof glyph === 'string') {
                    glyphParts = glyph.split('@');
                    glyph = glyphParts[0];
                    glyphFontFamily = glyphParts[1];
                } else {
                    glyphFontFamily = Ext._glyphFontFamily;
                }

                ret += '<span role="button" title="' + (item.altText || me.altText) + '" class="' + prefix + 'action-col-icon ' + prefix + 'action-col-glyph ' + prefix + 'action-col-' + String(i) + ' ' + (disabled ? prefix + 'item-disabled' : ' ') +
                    ' ' + (Ext.isFunction(item.getClass) ? item.getClass.apply(item.scope || scope, arguments) : (item.iconCls || me.iconCls || '')) + '"' +
                    ' style="font-family:' + glyphFontFamily + '"' +
                    (tooltip ? ' data-qtip="' + tooltip + '"' : '') + '>&#' +  glyph + ';</span>';
            } else {
                ret += '<img role="button" alt="' + (item.altText || me.altText) + '" src="' + (item.icon || Ext.BLANK_IMAGE_URL) +
                    '" class="' + me.actionIconCls + ' ' + prefix + 'action-col-' + String(i) + ' ' + (disabled ? prefix + 'item-disabled' : ' ') +
                    (Ext.isFunction(item.getClass) ? item.getClass.apply(item.scope || scope, arguments) : (item.iconCls || me.iconCls || '')) + '"' +
                    (tooltip ? ' data-qtip="' + tooltip + '"' : '') + ' />';
            }
        }
        return ret;
    }    
});

а также применил функцию getGlyph, например:

getGlyph: function(v, meta, rec) {
return 'xe600@icomoon';
}

Но по-прежнему не отображается значок или символ в столбце.

Я нашел следующий вывод из класса переопределения как

<span role="button" title="" class="x-action-col-icon x-action-col-glyph x-action-col-0   xe600@icomoon" style="font-family:icomoon">&#xe600;</span>

Что мне кажется нормальным. Не уверен, что здесь не так, может ли кто-нибудь мне помочь?


person Nitin Soni    schedule 21.09.2015    source источник
comment
кто-нибудь пробовал с этим. Пожалуйста, предложите.   -  person Nitin Soni    schedule 22.09.2015


Ответы (1)


Плохо, что я не мог проверить ссылку, которую я упомянул в своем вопросе:

Мне нужно добавить строку css в мой файл css для отображения глифов в столбцах действий:

.x-action-col-glyph {font-size:16px; line-height:16px; color:#9BC8E9; width:20px}

После этого отображаются глифы.

person Nitin Soni    schedule 22.09.2015