PDA

View Full Version : Action object initialzed in controller and set in view



mawverizon
11 Jun 2012, 7:53 AM
I want to create an action object (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Action (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.Action)) in my controller so that I can put this in multiple views and control it from a single location. All of my attempt to do so do not work. I've tried:

Create the action in the controller and "set" it on the view (which attempts to "set" it on the buttons). But there is no "action" member of components or containers.

Create the action in the controller and "set" it to a custom member of the view which uses that value to create the button. However, the initComponent() seems to execute before that object is set and other events are too late.

What is the best, most advisable approach to achieving this?