PDA

View Full Version : Change Form Drop Down Values on the Fly



joefox
31 Jan 2010, 9:57 AM
Just wanted to see if this was possible before i try it.

I have a grid, that when the user clicks, it will update some aspects of a form, primarly the drop down values they can select.

So for example, at first they have 5 or 6 values they can select. However, if they click on an item in my grid, it will pull from my database the values they can select.

Thanks in advance.

tobiu
31 Jan 2010, 11:55 AM
hi joefox,

definitely possible. take a look at:
http://www.extjs.com/deploy/dev/examples/grid/binding.html

this example does not use a form, but should help you quite a bit.

kind regards,
tobiu

joefox
31 Jan 2010, 4:25 PM
I dont know if that really helped.

By default i wanted to bind a dropdown to an xml file, or even a json object.
However, if they select something from my grid, it will get data from either a xml file, or json object, and change the values in the the drop downs.

Then I have a button to "reset" the form back to normal drop down values...

Just dont know where to look for this.

tobiu
31 Jan 2010, 11:03 PM
i would use the rowselect-event of the demo, then send the id of the entry in the grid to the server, get back the json / xml- response with the information what to filter.

the comboBox should have all possible entries in the store. then, i would filter the store of the combo with the information provided with store.filter() or store.filterBy() to only show the needed results.

kind regards,
tobiu