I'm using Zend + Dojo form in an intranet context. We need to update a list of counties when the selected state is changed on a form. With HTML you would just parse the json response (or just provide a html fragment of options) and update the innerhtml of the select. However, doing so in Dojo has proved to be prohibitively complex.
In short, I have defined a generic method that allows you to set an onBlur update to a form field. This links to a Controller action that calls the database with a function arguments, and gets back either a singleton response (which we handle okay already) or a list response. If we get back a list, we need to alter the options in a select with that list.
All of this works fine so far; we get a valid json reponse with a nice list in response.data. Here's where the problem is. How can I simply update the existing store (examination reveals it is a _comboBoxDataStore)? I cannot declare the select with a different kind of store, since it is auto-generated.
Is there any way to brute force a swap of stores? The main key is that whatever I do it has to work in Internet Explorer; My use of Firefox is only to allow better insight into the objects I'm working with.
As a side question, does anyone know why _comboBoxDataStore cannot be updated? Other frameworks allow for pretty seamless updating of stores, like for instance, extJS. Is there any reasoning behind designing a limitation into the combobox so it cannot be updated, which is a step down from raw HTML? Or am I missing the obvious solution that doesn't involve juggling a list of esoteric objects?