PDA

View Full Version : Select first element combobox after store ist load



max5komma2
23 Jun 2010, 2:58 AM
Hello,

how can i select the first element in the combobox automaticlly, when the itīs loaded?
The Combobox is a element of a Grid tbar...

My Code is:


new Ext.form.ComboBox({
id: 'search_mitarbeiter',
typeAhead: false,
editable:true,
triggerAction: 'all',
listClass: 'x-combo-list-small',
store: store_mitarbeiter,
displayField:'name',
valueField: 'mitarbeiter_id',
mode: 'remote',
allowBlank: false,
minListWidth:150,
width:150,
autoSelect: true,
selectOnFocus:true,
singleSelect: true

pavanextjs
23 Jun 2010, 9:21 AM
Try this...



combo.getStore().on('load', function(store, records, options){
combo.select(0); //first row
});