PDA

View Full Version : [FIXED] Widget combobox does not have drop down selection menu in Grid



cc.chaocui
8 Apr 2014, 10:08 AM
{
text: 'Run Mode',
dataIndex: 'rMode',
width: 150,
xtype: 'widgetcolumn',
widget: {
xtype: 'combo',
//value: 'Update',
store: ['a','b'],
listeners: {
'select' : function(combo){
//changeComponentValue(combo,gridModel,"rMode");
}
}
}}

The widget column combobox does not have a drop down menu when I click the combo box.

Also, this is a check tree grid, when I check any tree node, the widget column will disappear.

Am I using this in a wrong way?

Thanks

cc.chaocui
8 Apr 2014, 10:16 AM
I used Skirtle's Extension, everything works fine except the loading time. So I am trying to use this widget to render my tree grid cells.

Animal
8 Apr 2014, 4:40 PM
Try this override:



Ext.override(Ext.form.field.Text, {
applyTriggers: function(triggers) {
var me = this,
hideAllTriggers = me.getHideTrigger(),
readOnly = me.readOnly,
orderedTriggers = me.orderedTriggers = [],
repeatTriggerClick = me.repeatTriggerClick,
id, triggerCfg, trigger, triggerCls, i;

//<debug>
if (me.rendered) {
Ext.Error.raise("Cannot set triggers after field has already been rendered.");
}

// don't warn if we have both triggerCls and triggers, because picker field
// uses triggerCls to style the "picker" trigger.
if ((me.triggerCls && !triggers) || me.trigger1Cls) {
Ext.log.warn("Ext.form.field.Text: 'triggerCls' and 'trigger<n>Cls'" +
" are deprecated. Use 'triggers' instead.");
}
//</debug>

if (!triggers) {
// For compatibility with 4.x, transform the trigger<n>Cls configs into the
// new "triggers" config.
triggers = {};

if (me.triggerCls && !me.trigger1Cls) {
me.trigger1Cls = me.triggerCls;
}

for (i = 1; triggerCls = me['trigger' + i + 'Cls']; i++) {
triggers['trigger' + i] = {
cls: triggerCls,
extraCls: Ext.baseCSSPrefix + 'trigger-index-' + i,
handler: 'onTrigger' + i + 'Click',
compat4Mode: true,
scope: me
};
}
}

for(id in triggers) {
if (triggers.hasOwnProperty(id)) {
triggerCfg = triggers[id];
triggerCfg.field = me;
triggerCfg.id = id;

/*
* An explicitly-configured 'triggerConfig.hideOnReadOnly : false' allows {@link #hideTrigger} analysis
*/
if ((readOnly && triggerCfg.hideOnReadOnly !== false) || (hideAllTriggers && triggerCfg.hidden !== false)) {
triggerCfg.hidden = true;
}
if (repeatTriggerClick && (triggerCfg.repeatClick !== false)) {
triggerCfg.repeatClick = true;
}
if (triggerCfg.scope === 'this') {
triggerCfg.scope = me;
}

trigger = triggers[id] = Ext.form.trigger.Trigger.create(triggerCfg);
orderedTriggers.push(trigger);
}
}

Ext.Array.sort(orderedTriggers, Ext.form.trigger.Trigger.weightComparator);

return triggers;
}
});

Animal
8 Apr 2014, 4:42 PM
Also, the combobox's height and padding can make the row heights look bad and spoil alignment. I will fix that too.

Animal
8 Apr 2014, 4:42 PM
Thanks for the report! I have opened a bug in our bug tracker.