PDA

View Full Version : What is best way to populate a Select form field with ajax call?



profunctional
19 Jul 2010, 1:32 PM
I've looked through the samples, and only found how to set the options with static text. How does one go about setting the options array with items from an ajax call?

Should I be using the listeners events to detect when the select box is being drawn, then call ajax to add options? I'm just looking for the optimal way to do this.

Thanks.

evant
19 Jul 2010, 10:02 PM
That's probably best, put an empty options array to begin with, listen to the render event, make the call, then use the method I described in the other post to set the content.