1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
    mauzi75 is on a distinguished road

      0  

    Default 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:


    Code:
    config: {
            refs: {
                myref: '#myelement'
            }
        },
        
        control : {
            myref: {
                change : "onMyRefChange"
            }
        }
    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 : {
            '#myelement': {
                change : "onMyRefChange"
            }
        }



    2) with designer, I cannot bind a custom event for an element. For example:


    Code:
    config: {
        
        control : {
            '#myelement': {
                customevent: "onMyElementCustomEvent"
            }
        }
    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.

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,185
    Vote Rating
    63
    aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice

      0  

    Default


    Not yet, but it will be.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    972
    Vote Rating
    47
    ssamayoa has a spectacular aura about ssamayoa has a spectacular aura about

      0  

    Default


    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!

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
    mauzi75 is on a distinguished road

      0  

    Default


    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,...);

  5. #5
    Sencha User
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    972
    Vote Rating
    47
    ssamayoa has a spectacular aura about ssamayoa has a spectacular aura about

      0  

    Default


    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!

  6. #6
    Sencha User
    Join Date
    Jul 2010
    Posts
    6
    Vote Rating
    0
    rsringeri is on a distinguished road

      0  

    Default


    Looks like that not been fixed in Architect 2 release version either. Thanks for the workaround.