PDA

View Full Version : Best way to load values from a model back into form components / 1way model binding



ELRG
6 Nov 2013, 12:30 PM
Hello,I have a relatively complex query submission page on my app that has several fieldsets themselves made up of numberfields, checkboxes, textboxes and custom components (made up of the same)living inside a form panel. I need to be able to allow the user to load past and saved queries, populating all of the fields with those values. All of the parameters are stored in a model, and when a query is submitted the model is populated and passed on to the controller and the ajax call. Now I need to load a saved query, from the json serialization of that model. What is the best way to do that, Im assuming I cant just do a formpanel.loadRecord(json) and let the framework figure it out.Is there an easier way to load or 1-way bind the model without manually taking every component and iterating over the model, updating the values?

Gary Schlosberg
22 Nov 2013, 2:51 PM
Here's a docs link that might help:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.action.Load