1. #1
    Sencha User lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    531
    Answers
    6
    Vote Rating
    3
    lorezyra will become famous soon enough

      0  

    Default Answered: Re: Communication between controllers

    Answered: Re: Communication between controllers


    In reference to the Q&A for http://www.sencha.com/forum/showthre...ion+event+fire ...

    I would like to know the proper way to pass parameters/args to the function of the application controller.

    According to the API, I only need to specify as follows:
    fireEvent( String eventName, Object... args )
    I've tried the following, but neither appear to work...
    PHP Code:
    this.application.fireEvent("adminlogevent""testing...");
    this.application.fireEvent("adminlogevent", {msg"testing..."}); 
    The function works fine for the controller that houses it.
    PHP Code:
    //...
        
    init:function(){
            if(
    Ext.isGecko && debugconsole.log(" adminUIviewport.controllerInit()");
            var 
    me=this;
            
    me.application.on({//handle system-application wide events and calls here!!
                
    'systemlogoff'me.adminUIappLogoff,
                
    scopeme
            
    },{
                
    'adminlogevent'me.adminUIappLogBoard,
                
    scopeme
            
    });


    //...
        
    adminUIappLogBoard: function(msg){
            if (
    msg) {
                var 
    timeStamp= new Date();
                
                if(
    Ext.isGecko && debug){console.info(Ext.util.Format.date(timeStamp,"Y/m/d G:i:s") + ":  " msg);}
                
    Ext.StoreMgr.lookup('adminUILog').add({dateTimeExt.util.Format.date(timeStamp,"Y/m/d G:i:s"),descmsg});
                
    //TODO: scroll to bottom of grid?
                /*
                var logHeight=Ext.getCmp("adminUILogger").getHeight();
                Ext.getCmp("adminUILogger").setScrollTop(logHeight); // object.scrollTop = object.scrollHeight
                */
            
    }
        } 
    Can anyone enlighten me? Also, the docs say that fireEvent is supposed to return a Boolean. In firebug, it shows the return as undefined. Is this a bug?
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!

  2. Found the problem! My syntax for this.application.on() was incorrect. Just like the this.control() config, I needed to correctly define my syntax!


    PHP Code:
    //...
        
    init:function(){
            if(
    Ext.isGecko && debugconsole.log(" adminUIviewport.controllerInit()");
            var 
    me=this;
            
    me.application.on({//handle system-application wide events and calls here!!
                
    'systemlogoff'me.adminUIappLogoff,
                
    'adminlogevent'me.adminUIappLogBoard,
                
    scopeme
            
    });


    //...

            


  3. #2
    Sencha User lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    531
    Answers
    6
    Vote Rating
    3
    lorezyra will become famous soon enough

      0  

    Default source code

    source code


    Looking at the (4.0.7) source, it appears that you can simply add on the parameters after the eventName.

    PHP Code:
    fireEvent: function(eventName) {
        var 
    name eventName.toLowerCase(),
            
    events this.events,
            
    event events && events[name],
            
    bubbles event && event.bubble;

    return 
    this.continueFireEvent(nameExt.Array.slice(arguments1), bubbles); 
    So, this should be valid:
    Code:
    this.application.fireEvent("adminlogevent", "testing...");
    I'm going to double check my scoping...
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!

  4. #3
    Sencha User lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    531
    Answers
    6
    Vote Rating
    3
    lorezyra will become famous soon enough

      0  

    Default


    Found the problem! My syntax for this.application.on() was incorrect. Just like the this.control() config, I needed to correctly define my syntax!


    PHP Code:
    //...
        
    init:function(){
            if(
    Ext.isGecko && debugconsole.log(" adminUIviewport.controllerInit()");
            var 
    me=this;
            
    me.application.on({//handle system-application wide events and calls here!!
                
    'systemlogoff'me.adminUIappLogoff,
                
    'adminlogevent'me.adminUIappLogBoard,
                
    scopeme
            
    });


    //...

            

    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!

  5. #4
    Sencha User lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    531
    Answers
    6
    Vote Rating
    3
    lorezyra will become famous soon enough

      0  

    Default furthermore

    furthermore


    Both of these do, in fact, work...

    PHP Code:
    this.application.fireEvent("adminlogevent""testing...");
    this.application.fireEvent("adminlogevent", {msg"testing..."}); 
    However, the second statement (obviously) passes an object instead of the text. My function expects a string...
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar