View Full Version : Combo Box not working on a FormPanel

26 Apr 2011, 4:52 AM
Hi guys...

I need some help with this...

I have a FormPanel within a WindowPanel and in the formpanel a combo box, the thing is that it doesn't work the way it should. it gives to "errors":
1. the combo box just can't populate (I tried some tips from other threads, but it just can't wok properly)
2. the next combo box on the formpanel appears with a top style unusual, it stays to far apart from the first item on the form (If I change the combo to a textfield, it works like it should...)

Here's a screenshot: http://img402.imageshack.us/i/screenshotknm.png
Here is the code I'm using:

items: [
id: 'NewMailForm',
xtype: 'form',
baseCls: 'x-plain',
url: 'Processors/SendEmail.exe',
labelWidth: 55,
layout: {
type: 'vbox',
align: 'stretch'
items: [
id: 'to',
xtype: 'combo',
height: 30,
maxHeight: 50,
loadingText: 'A Carregar...',
triggerAction: 'all',
minChars: 3,
mode: 'remote',
hideTrigger: true,
store: new Ext.data.JsonStore({
storeId: 'Contacts-Store',
url: 'Processors/Contacts.exe',
root: 'Contacts',
totalProperty: 'Total',
fields: [
sortInfo: {
field: 'Name',
direction: 'DESC'
plugins: [Ext.ux.FieldLabeler],
fieldLabel: 'Para',
name: 'to'
/* Rest of the code */

Can anyone help???

26 Apr 2011, 8:55 AM
I don't see a 'displayField' set on your combo, so it doesn't know what store field to display. I also don't see a 'valueField'. Regarding the combo not loading, have you tried 'autoLoad: true' on the combo's JsonStore?

Here's a combo sample taken from some functional code:

xtype: 'combo',
displayField: 'productName',
// editable: false,
fieldLabel: 'Product',
forceSelection: true,
hiddenName: 'productId',
hiddenValue: 'productId',
mode: 'remote',
store: app.store.product,
triggerAction: 'all',
typeAhead: true,
valueField: 'productId',
width: 290

26 Apr 2011, 7:07 PM
thanks for the reply...

with the displayField, now the combobox is populated...
Now the distance gap between the two combos remains...

any ideas?

27 Apr 2011, 9:26 AM
Since you're using a vbox layout, try adding 'flex: 0' to the combos.

Alternately, you could eliminate the layout block completely, where the default 'form' layout will stack the components vertically by default.