I started developing a prototype in ExtJS4 following their new MVC pattern. I have a master form (customers) with a list of customers (grid) and a details form, double-clicking on a row in the grid opens the details form. Currently, I have done in the controller for the master form like this:
var view = Ext.widget('CustomerDetailsView');
view.show();
But I also need to pass in the customerID to the details form to have the details form load additional data for the customer. In the simple MVC sample app at the Sencha web site this is done by:
view.down('form').loadRecord(selectedRecord);
So the way I understand this is that the details view is loaded with the whole record from the master view. First, my details view has it's own controller and store, and second, that does not seem like the right way to communicate between views.
- Shouldn't the Master controller somehow call the Details controller?
- in another post here it was suggested using events for all this communication between views/controllers, but I am not sure it makes sense to create all these application-wide events just for a simple master/details communication
What is the suggested way to pass data to a child view/controller in the ExtJS4 MVC application pattern?