PDA

View Full Version : confuse about combobox



vee.ant
26 Jun 2009, 12:16 AM
i want to use combobox by xtype 'combo' on my code
but the data is not shown,
how can i fix this???

its like this


var store_ket = new Ext.data.SimpleStore({
fields: ['ket'],
data : [
['Terlaksana'],
['Tidak Terlaksana']
]
});

.......
-then here is formPanel-
-inside the formPanel there is a comboBox like this-
...........................
...........................
} , {
xtype:'combo',
fieldLabel: 'Keterangan',
name: 'keterangan',
store: store_ket,
displayField: 'ket',
width: '100'
} , {
...........................
...........................
.......


have i missing something??

vee.ant
26 Jun 2009, 12:26 AM
yope, its fixed...
after try for an hour, its just because i didn't add mode on the combobox
so i add mode:'local'

its like
......................
} , {
xtype:'combo',
fieldLabel: 'Keterangan',
name: 'keterangan',
store: store_ket,
displayField: 'ket',
mode:'local', --> this is fixed my combobox
width: '100'
} , {
............

rather than,
......................
} , {
xtype:'combo',
fieldLabel: 'Keterangan',
name: 'keterangan',
store: store_ket,
displayField: 'ket',
width: '100'
} , {
............

ok, sorry for this mistake:)

BitPoet
26 Jun 2009, 12:29 AM
Set


triggerAction: 'all',
mode: 'local'

in the combo config. "mode: 'local'" avoids your combo firing a load event to the store, "triggerAction: 'all'" keeps it from trying to filter the displayed entries once you have made a selection.