You found a bug! We've classified it as
EXTJS-16430 .
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.Ext.grid.column.Action -> disabled config
Ext.grid.column.Action -> disabled config
hi team,
in case you create an action item like this:
Code:
{
//...
iconCls : 'icon-pencil',
disabled : true
}
this will generate the following DOM:Code:
class="x-action-col-icon x-action-col-0 x-item-disabledicon-pencil"
one blank character can be importanttested with 5.1.0.107
well, looks trivial to fix:
Code:
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;
// 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));
// 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;
}
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;
},
since this is hard to spot though:without blank char:
Code:
(disabled ? prefix + 'item-disabled' : ' ')
withCode:
(disabled ? prefix + 'item-disabled ' : ' ')
Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager:
sheryl@sencha.com
[OPEN] Ext.grid.column.Action -> disabled config
Aucun commentaire:
Enregistrer un commentaire