Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    83
    Vote Rating
    1
    scottd is on a distinguished road

      0  

    Default Controllers should not have an events config (they can't have basic event bindings)

    Controllers should not have an events config (they can't have basic event bindings)


    I just created a new Controller and added a reference to my main Panel, as follows:

    Ext.define('MyApp.controller.ChangeStorePanelController', {
    extend: 'Ext.app.Controller',
    config: {
    refs: {
    mainForm: 'widget.changeStoreAndRole'
    }
    }
    });

    Now I want to add an event handler for the 'mainForm' panel. I select my Controller in the Project Inspector, click on the Events row to add the event, and there is no content in the Events selector. Since the field is read-only, there's nothing I can do here. I'm going to have to abandon Architect and complete the project by hand to prevent working code from being overwritten by simple updates to the UI.
    Attached Images

  2. #2
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,911
    Vote Rating
    62
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    You can't add events to controller you should be adding controller actions in their stead. The bug here is that you have an events config at all and it will be removed.
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    83
    Vote Rating
    1
    scottd is on a distinguished road

      0  

    Default


    Okay, then. So if I'm using Architect and don't want it to overwrite my hand-edited files, how do I install event handlers? By hand, it would look like this, but how do I generate the control block with the tool?

    config: {
    refs: {
    'mainForm': 'changeStoreAndRole'
    },


    control: {
    'mainForm' : { initialize : 'onInitialize' }
    }
    },

  4. #4
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,911
    Vote Rating
    62
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    Yeah good question.

    Add a controller reference for the refs

    ref: mainForm
    selector: 'changeStoreAndRole'

    Add a controller action for the control block

    controlQuery: 'mainForm'
    targetType [choose the type of the component, so you can then choose the event binding name]
    name: initialize
    fn: will automatically become onInitialize .. which of course you could change

    also see http://docs.sencha.com/architect/2-0...de/controllers
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

Thread Participants: 1