View Full Version : Dynamic Form design question

14 Sep 2012, 6:39 PM

I'm redesign my Family registration page. I want to use Fieldsets, one for the husband data (fname, lname, dob...) and another for the wife (fname, lname...) Currently I am thinking what kind of fields I should use for children. I want to have some thing flexible because each family has different number of children or no children.
I think I may have a grid to list children and a form next to it. The user can fill out the form with a child's data. The user clicks "Add", the child is added to the Grid. However it's not straightforward to me how to read children data when the user submits the registration.

I'd like to hear other suggestions from people in this forum and I very appreciate any help.


14 Sep 2012, 7:14 PM
I think your solution is OK. On submitting form, you just need to scan thru the store that is bound to the grid to get out children data and send it thru params option of <form>.submit().

14 Sep 2012, 7:18 PM
Another thought that I can use Ext.grid.plugin.RowEditing for the Children section. In this way I don't need a form to collect a child's data. However how do I do so that when the grid is loaded empty at the 1st time and the user clicks to add a new entry?


15 Sep 2012, 12:01 AM
Create a button that creates a new (empty) record and simply add that record to grid.
You could also add a something like dblclick event to grid view and achieve the same without the button.

15 Sep 2012, 9:43 AM
Hi vietits and metalinspired,

Thank you for your tips! I just installed Sencha Architect in the hope that it facilitates the work. Hopefully the learning curve won't take long. I like the dblclick idea and will try it.