-
28 Mar 2012 9:30 AM #1
What I cannot do with Controller and Designer..
What I cannot do with Controller and Designer..
Are these two considerations about controllers and designer true or false?
1) when I add a controller action, I cannot use a "refs" element. For example:
it's impossible to do with designer, because I can use only a "compomentQuery" selector for the control object, like this:Code:config: { refs: { myref: '#myelement' } }, control : { myref: { change : "onMyRefChange" } }
Code:config: { refs: { myref: '#myelement' } }, control : { '#myelement': { change : "onMyRefChange" } }
2) with designer, I cannot bind a custom event for an element. For example:
it's impossible to do with designer, because I have always to choose a targetType for the controller action and then bind one of the predefined events for that type.Code:config: { control : { '#myelement': { customevent: "onMyElementCustomEvent" } }
-
28 Mar 2012 9:46 AM #2
Not yet, but it will be.
Aaron Conran
@aconran
Sencha Architect Development Team
-
28 Mar 2012 11:23 AM #3
For 2, is a little bit annoying but you can create the event and call your custom action/function. I have to to this way because you cant associate the same event to different components.
Regards.UI: Sencha Architect 2.x / ExtJS 4 MVC
Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
Application Server: Glassfish 3.1.x
Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5
If you like my answer please vote!
-
29 Mar 2012 3:26 AM #4
Ok, I will wait for a new great release of Designer ;-)
2) yes, there are many workarounds for the second issue; this is mine: in the controller use a "controller action" and a "basic function" to do this
Code:config: { control: { "#mycomponent": { initialize: 'onMyComponentInitialize' } } }, onMyComponentInitialize: function(component, options) { //workaround for Designer custom events missing) component.on({ mycomponentevent: this.onMyComponentEvent, scope: this }); }, onMyComponentEvent: function(param1, param2, ...) { //make what you need: this code is executed when "mycomponent" fires "mycomponentevent" }
on the component fire the event where you want
Code:this.fireEvent("mycomponentevent",param1,param2,...);
-
29 Mar 2012 5:47 AM #5
I been using SD for ExtJS only and initialize event dont exists

Thats the reason I cant be able to add custom events on controllers even if I can craft a custom component which fires them.
Regads.UI: Sencha Architect 2.x / ExtJS 4 MVC
Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
Application Server: Glassfish 3.1.x
Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5
If you like my answer please vote!
-
19 Apr 2012 2:08 PM #6
Looks like that not been fixed in Architect 2 release version either. Thanks for the workaround.


Reply With Quote