PDA

View Full Version : Extremely Basic comboBox question



heidtmare
26 Nov 2007, 1:24 PM
How do i tell my comboBox to display the first item in the list, instead of a blank by default?

catacaustic
26 Nov 2007, 2:04 PM
If you know what the first value that you want to show is, you can use
value: 'showthis'in the config for the ComboBox. If not, then when the ComboBox is rendered, you can do
combo.select (0);and that will select the first item in the list.

Just remember... For either of these to work, you have to have the data store that is attached to the ComboBox loaded before you render the ComboBox on your page.

tryanDLS
26 Nov 2007, 2:10 PM
combo.select(0) only works if the combo is expanded. If not, just call setValue passing the value from row 0 of the store.