-
1 Apr 2012 5:42 PM #1
combobox boundlist width
combobox boundlist width
Recently upgraded to 4.1rc1, and I'm trying to figure out how to get combobox boundlists to auto-width-ify themselves.
The combo boxen in question have matchFieldWidth: false. under 4.0.7 This was broken, and required the following patch:
Now, under 4.1rc1, the patch is no longer necessary to support matchFieldWidth:false, but the trouble is: unless you set an explicit width, it'll use the minWidth value to set the actual width style.Code:Ext.override(Ext.form.field.Picker, { alignPicker: function() { var me = this, picker = me.getPicker(); if (me.isExpanded) { if (me.matchFieldWidth) { // Auto the height (it will be constrained by min and max width) unless there are no records to display. picker.setWidth(me.bodyEl.getWidth()); } else { // MODIFIED - this else block added picker.setSize( me.listConfig ? me.listConfig.width || null : null, ( picker.store && picker.store.getCount() ) ? null : 0 ); } if (picker.isFloating()) { me.doAlign(); } } } });
I don't know what other components this might apply to, but even picker.setWidth(null) or picker.setWidth('auto') now appear to be ineffectual. ( picker is an Ext.view.BoundList )
It won't un-set the width style on the boundlist as it so graciously did before.
I'd attempt to debug this more myself, but the guts of the new layout system appear to be manifest of some freaky black-magic that I do not yet understand.
How do we restore this little gem of functionality?
-
1 Apr 2012 6:55 PM #2
I had a go at reproducing this issue using the following test case:
It renders fine initially but goes wrong once you start typing in values.Code:Ext.create('Ext.form.field.ComboBox', { matchFieldWidth: false, renderTo: ..., store: ['Red', 'Orange', 'Yellow Lorry Red Lorry Green Lorry'] });
If this is the same problem, it seems to be fixed in the latest nightly build.


Reply With Quote