How to dynamically set a value on a combo
It can happen that you have to set a value on a combo-box dynamically, and maybe even if the combo has never been opened (thus the store never loaded all the values). To correctly set a value and make the combo show the relative description you have to load the store and use the callback function to set the value:
Watch out if you have to do the same process inside a loop: The store.load is an asynchronous method and the response might get back after many loop cycles! To correctly set a value inside a loop you have to create a scoped function like this:
This way the i will not change
Last updated