PDA

View Full Version : Ext.form.ComboBox grow:true does not grow to match content length of options



Nick
30 May 2007, 1:37 PM
Setting grow to true does not seem to work. See example, here:
http://www.mixolution.com/extjs/examples/comboBox.html
uses extjs version 1.0.1a (also tested with 1.0.1 w/ same issue)

In my case, I don't know the length of the options, so I want the comboBox to be the length of the longest option (i.e. grow to size).
Is there a work around?
I am misinterpreting what 'grow:true' does?




Ext.onReady(function() {
var store = new Ext.data.SimpleStore({
fields: ['value', 'display'],
data : [['', '- Select -'],
['1', 'My Option One'],
['2', 'My Option Two'],
['3', 'This option is really, really long, but does not seem to grow. It is truncated.']
]
});
var combo = new Ext.form.ComboBox({
store: store,
displayField:'display',
typeAhead: false,
mode: 'local',
triggerAction: 'all',
selectOnFocus:false,
editable: false,
value: '- Select -',
grow:true
});
combo.applyTo('combo1');
});

zquirm
30 May 2007, 1:48 PM
Here you go...

http://extjs.com/forum/showthread.php?t=6261

jack.slocum
30 May 2007, 1:48 PM
grow is not compatible with combobox (or any TriggerField). The docs attempt to remove the config options from the documentation at the TriggerField level but that didn't seem to work in the last release. I have updated the docs in a way that works for the next release.