1. #1
    Sencha User
    Join Date
    Feb 2009
    Location
    India
    Posts
    69
    Vote Rating
    1
    arvindwill is on a distinguished road

      0  

    Default Answered: Panel click event

    Answered: Panel click event


    Since panel dont have click event cant able to attach listeners in mvc style. What is the equivalent way to achieve panel click event in MVC design

  2. Try this:

    1. View code
    Code:
    Ext.define('App.view.Panel', {
        extend: 'Ext.panel.Panel',
        alias: 'widget.apppanel',
        bodyCls: 'entity_draw',
        ...
        listeners: {
            click: {
                element: 'el',
                fn: function(){
                    var panel = Ext.getCmp(this.id);
                    panel.fireEvent('click'); // fire 'click' event from panel
                }
            }
        }
    });
    2. Controller
    Code:
    ...
    init: function(){
        this.control({
            'apppanel': { // 'panel[bodyCls=entity_draw]'
                click: function(){
                    console.log('panel is clicked');
                }
            }
        });
    }

  3. #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

      1  

    Default


    Try this:

    1. View code
    Code:
    Ext.define('App.view.Panel', {
        extend: 'Ext.panel.Panel',
        alias: 'widget.apppanel',
        bodyCls: 'entity_draw',
        ...
        listeners: {
            click: {
                element: 'el',
                fn: function(){
                    var panel = Ext.getCmp(this.id);
                    panel.fireEvent('click'); // fire 'click' event from panel
                }
            }
        }
    });
    2. Controller
    Code:
    ...
    init: function(){
        this.control({
            'apppanel': { // 'panel[bodyCls=entity_draw]'
                click: function(){
                    console.log('panel is clicked');
                }
            }
        });
    }

Thread Participants: 1

Tags for this Thread

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