PDA

View Full Version : Arraystore in ComboBox



Christian-mo
5 Aug 2010, 4:52 AM
Hi.

i have a combobox, with the arraystore "STORE_THRESHOLD"
If i invoke my page i see a combobox with a "blank" line.
If i click into ComboBox Arrow rightside, i see my Store Data.

Any idea how to forbid this Blank line, so that only the Data from my store appears and not a blank line ?

Im using extjs 3.2.1 with ExtDesigner 1.0.2.11

Best regards
Christian




Here is some source code:

The store:


STORE_THRESHOLD = Ext.extend(Ext.data.ArrayStore, {
constructor: function(cfg) {
cfg = cfg || {};
STORE_THRESHOLD.superclass.constructor.call(this, Ext.apply({
storeId: 'STORE_THRESHOLD',
autoLoad: true,
data: [
[ "8 V", 8],
[ "9 V",9 ],
....]
fields: [
{
name: 'txt'
},
{
name: 'val'
}
...
And this is the Combo:



{
xtype: 'combo',
fieldLabel: 'THRESHOLD',
anchor: '100%',
submitValue: true,
store: 'STORE_THRESHOLD',
valueField: 'val',
displayField: 'txt',
mode: 'local',
ref: '../TIMEPROFILE',
id: 'TIMEPROFILE'
},

Condor
5 Aug 2010, 5:06 AM
You mean a blank line in the dropdown list or the <input> element itself (which isn't a 'line')?

If you just want to initialize the combobox then you should specify a value, e.g. value:8

Christian-mo
5 Aug 2010, 5:10 AM
i have to enter a "value" :((
Now it works.
Thank you !!