Simple ExtJS drop down list

Tuesday, 27 January 2009 13:53
Print
Share/Save/Bookmark
I've just spent almost two hours trying to get simple drop down list into my script. I would swear I've done it like it's done in an example on ExtJS page.

I was almost at the end of my nerves and I even considered to abandon ExtJs and go back to simple html where everything was much easier :)


Then ... like so many times before it "just started" to work !!!  :) Code that works is provided below.

var my_values = [
    ['one'],
    ['two'],
    ['three'],
    ['four'],
    ['five']
];
 
 
var numberField = new Ext.form.ComboBox({
    fieldLabel: 'Number',
    hiddenName: 'number',
    store: new Ext.data.SimpleStore({
        fields: ['number'],
        data : my_values 
    }),
    displayField: 'number',
    typeAhead: true,
    mode: 'local',
    triggerAction: 'all',
    emptyText:'Choose number...',
    selectOnFocus:true
});
Last Updated ( Monday, 04 May 2009 20:26 )