PDA

View Full Version : [FIXED]Combo Box List Width



James Goddard
17 Feb 2011, 1:31 PM
Neither method for setting the combo box list width seems to work within a form.

I've tried both setting matchFieldWidth: true and setting listWidth.

In both cases I get a width significantly wider than specified. See attachment.

evant
19 Feb 2011, 2:56 AM
Can you please post some sample code to demonstrate the issue? Also the browser version.



Ext.require([
'Ext.form.FormPanel',
'Ext.layout.container.Anchor',
'Ext.data.*'
]);

Ext.onReady(function() {
Ext.create('Ext.form.FormPanel', {
renderTo: Ext.getBody(),
title: 'Form Panel',
bodyStyle: 'padding:5px 5px 0',
width: 600,
fieldDefaults: {
labelAlign: 'top',
msgTarget: 'side'
},
defaults: {
border: false,
xtype: 'panel',
flex: 1,
layout: 'anchor'
},

layout: 'hbox',
items: [{
items: [{
xtype:'textfield',
fieldLabel: 'First Name',
anchor: '-5',
name: 'first'
}, {
xtype:'textfield',
fieldLabel: 'Company',
anchor: '-5',
name: 'company'
}]
}, {
items: [{
xtype:'combo',
fieldLabel: 'Last Name',
anchor: '100%',
store: [[1, 'One'], [2, 'Two'], [3, 'Three']]
},{
xtype:'textfield',
fieldLabel: 'Email',
anchor: '100%',
name: 'email',
vtype:'email'
}]
}],
buttons: ['->', {
text: 'Save'
}, {
text: 'Cancel'
}]
});
});

James Goddard
21 Feb 2011, 6:04 AM
Sure. The browser is chrome 9.0.597.98, and I've also verified it with firefox.


this.mainFrame = Ext.create ('widget.window', {
bodyBorder: false,
closable: false,
layout: 'hbox',
modal: true,
onExc: Ext.emptyFn,
resizable: false,
title: this.translate ('login', true),
width: 391,
items: [{
width: 111,
height: 166,
xtype: 'box',
autoEl: {
tag: 'img',
src: 'img/login.png',
alt: ''
}
}, {
xtype: 'form',
baseCls: 'x-plain',
defaultButton: 'login',
autoHeight: true,
width: 240,
margins: '5px 5px 5px 15px',
defaults: {
validateOnBlur: false,
validationEvent: false,
allowBlank: false
},
defaultType: 'textfield',
items: [{
name: 'userName',
fieldLabel: 'User Name'
}, {
name: 'passwd',
inputType: 'password',
fieldLabel: 'Password'
}, {
xtype: 'combo',
fieldLabel: 'Language',
allowBlank: false,
editable: false,
forceSelection: true,
queryMode: 'local',
store: 'stores.LoginLanguages',
triggerAction: 'all',
displayField: 'text',
valueField: 'value',
value: language,
matchFieldWidth: true
// listWidth: 127
}],
buttons: [{
text: 'Login',
id: 'login',
scope: this,
handler: function (b) {
}
}]
}]
});

this.mainFrame.show();

evant
22 Feb 2011, 11:23 PM
Ok thanks, a fix has been added.

James Goddard
23 Feb 2011, 5:29 AM
Great. Thanks!

James Goddard
25 Feb 2011, 9:51 AM
Confirmed fixed in pr2.