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
    9,266
    Vote Rating
    121
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


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

  3. #3
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,267
    Vote Rating
    81
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      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 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    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 Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,267
    Vote Rating
    81
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      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 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    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.