PDA

View Full Version : Initial value for combobox with autocomplete and remote store



pharod
16 Aug 2011, 8:31 AM
Good day,

I have a form with combobox backed by remote store and with auto-complete.
Expanding list of all values is disabled as I have 40 000 values to select from.
When form is loaded to edit entity I populate all fields with current values.
How can I set value of initial value for combobox?

skirtle
16 Aug 2011, 3:41 PM
Can't you do it the same as you would with any other field? Either use the value config option or the setValue() method. Depending on your configs this may work, or it may not.

If it doesn't work, could you post the configs for your store and combobox?

mberrie
16 Aug 2011, 6:38 PM
Note that there are some issues with ComboBox related to setting a value - maybe you are affected by one of them:


setting a value that is not in the list
setting a value when the store is not loaded yet


http://www.sencha.com/forum/showthread.php?138434-Setting-the-editable-combobox-to-a-value-that-is-not-in-the-list-results-in-empty-val

http://www.sencha.com/forum/showthread.php?124702-OPEN-ComboBox-s-setValue-call-with-a-remotely-loaded-Store&highlight=setvalue