how to add dynamic radio buttons, checkboxes to a form
1) I'm extending Ext.form
2) In the extended widget, I will pass in information to my constructor with information describing groups of radio buttons to be rendered on the form
3) I will make an XHR request to populate a store for my form
4) In addition, I need to make multiple additional XHR requests to determine how many groups of radio buttons, and within those, how many individual radio buttons I need and what their values are, and populate associated stores for those
My problem is since I don't know how many groups of radio buttons I'm dealing with ahead until runtime, and I need to load up a store with an HttpProxy request for each group of those, and I need for that loading to happen prior to building the form because that information tells me how many groups of radio buttons I have, I need to wait on each of those stores to load before trying to build the form.
I'm thinking of trying to chain listeners to each of those stores ... so that I load the first store, listen for its load event, then load the second store ... etc. until all the listeners are fired, and then build the form.
2 Questions:
a) Is there a more straightforward way for me to ensure that I complete all the XHR requests I need to complete prior to building the form? Can I do something like provide a listener for completion of a group of events?
b) Does Ext provide a mechanism for logically grouping radio buttons (and for that matter, also checkboxes)?
As far as question 2, I was referring more to logical grouping than UI grouping. i.e. if I have a field in my database called "color", and the current value in the database for the field is "red", and the possible values for "color" are red, green, and blue, then I'd like 3 radio buttons: one for red, one for green, and one for blue, with red selected since that is the current value for the field. Then, clicking any of the three radio buttons should update the underlying value in the data store -- i.e. clicking on the "blue" radio button should make the store's record dirty and change the value of the "color" field to blue.
I realize this is probably not available currently... if not then please consider this feature for future releases ... tying groups of radio buttons, and groups of checkboxes, to single fields within a store would be very valuable.
2. If you mean as far as UI, no there is nothing to do this. However, you can just add a container to your form, and set an id: 'my-id' on it. Then, create and render your lists into that id after the form is rendered.
#If you have any other info about this subject , Please add it free.# |

