Hybrid View

  1. #1
    Sencha User
    Join Date
    Feb 2009
    Location
    India
    Posts
    65
    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
    109
    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

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