PDA

View Full Version : Mvc app: passing stores to children panels



WagsMax
14 Oct 2012, 9:41 AM
In my mvc app, I have the following scenario. store1 contains grid panel rows, and store2 contains combobox options for one of the fields in store1. Its easy to set the store for the grid panel in 2. using the store: config, but I can't figure out how to set the store: config for one of the fields in 3.

1. controller <- creates store1, store2, grid panel, sets config store: store1 for grid panel in 2., displays grid panel 2.
2. grid panel <- dbl-click row creates form panel 3.
3. form panel <- has a combobox field that should somehow set store: to store2 from 1. above

My question is, how do I pass store2 down through the chain from 1. to 2. to 3. and then set the field store: config in 3. to store2? Or is there a different/better way to do this?

I have seen lots of examples of inline code doing this with variables, but nothing that shows how to do it with mvc. Also note that 1. creates new instances of 2. and 3. - therefore the stores are not static.

vietits
14 Oct 2012, 11:41 PM
Where do you put the code of creating form panel 3 basing on the double clicking on row of grid 2? Often with MVC application, this should be the role of controller and if you follow the same way then creating form panel 3 will be the same as creating grid panel 2.