1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    3
    Vote Rating
    0
    lpe2012 is on a distinguished road

      0  

    Default Unanswered: Reference component in controller

    Unanswered: Reference component in controller


    Hi,

    I have the component below in a panel. I need to reference this in teh controller so I can catch
    the event when a user clicks in this link. Any suggestions wil be appreciated.

    {
    /*
    * Insert a link
    *
    */
    xtype: 'container',
    layout: {type: 'hbox'},
    margin: '10 0 0 40',
    cls: 'auto-test-Cua-Report-Link',
    items: [
    {
    xtype: 'box',
    html: '> '
    },
    {
    xtype: 'box',
    autoRender: true,
    autoEl:
    {
    tag: 'a',
    href: 'CuaReport: CuaReport',
    title: Irm.imc.language.translate('tooltips.message.cuareport'),
    onclick: 'return false;',
    html: Irm.imc.language.translate('manageusers.buttons.cuareport')
    }
    }
    ]
    }

  2. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    Try this:
    Code:
            ....
            items: [{
                /*
                * Insert a link
                *
                */
                xtype: 'container',
                layout: {type: 'hbox'},
                margin: '10 0 0 40',
                cls: 'auto-test-Cua-Report-Link',
                items: [{
                    xtype: 'box', 
                    html: '> '
                },{
                    xtype: 'box', 
                    autoRender: true,
                    autoEl: {
                        tag: 'a', 
                        href: 'CuaReport: CuaReport', 
                        title: Irm.imc.language.translate('tooltips.message.cuareport'), 
                        onclick: 'return false;', 
                        html: Irm.imc.language.translate('manageusers.buttons.cuareport')
                    },
                    listeners: {
                        click: {
                            element: 'el',
                            fn: function(){
                                var cmp = Ext.getCmp(this.id);
                                cmp.up('container').fireEvent('click');
                            }
                        }
                    }
                }]
            },{
                 ....
            }]
            ....
    Suppose that component above is inside a panel, then you can refer to this component from controller as below:
    Code:
        this.control({
            'panel container': {
                click: function(){
                   console.log('link clicked');
                }
            }
        });

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi