PDA

View Full Version : combo box not showing items



dranney
3 May 2011, 10:20 AM
The following code loads successfully, but the combo box is not showing items. I can see the items in firebug, but 'Select a Strategy...' is the only thing in the combo box. Can anyone tell me what's wrong?

<code>
var comboBox = new Ext.form.ComboBox({
fieldLabel: '',
id:'strategy',
store: new Ext.data.ArrayStore({
fields: ['name', 'value'],
data: [['Average', 'Average'],
['Floor', 'Floor'],
['Ceiling', 'Ceiling']]
}),
valueField:'value',
displayField:'name',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Select a Strategy...',
selectOnFocus:true,
width:140
})
strategyPanel = new Ext.FormPanel({
labelWidth: 5,
frame: true,
title: 'Strategy',
bodyStyle:'padding:0px 0px 0',
height: 100,
width: 200,
items: comboBox
});
</code>

carol.ext
3 May 2011, 11:14 AM
How are you displaying the panel? What version, what browser, etc?

I added a window and put strategyPanel in it and it shows the items okay.


var w = new Ext.Window({
items: strategyPanel
});
w.show();

p.s. code tags use square brackets.