-
27 Apr 2012 10:25 AM #1
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.
-
27 Apr 2012 10:36 AM #2
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
Known Bugs in Architect Latest
-
27 Apr 2012 12:10 PM #3
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' }
}
},
-
1 May 2012 6:25 AM #4
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/controllersPhil Strong
@philstrong
#SenchaArchitect
Sencha Architect Development Team
Known Bugs in Architect Latest
Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.


Reply With Quote