Hybrid View

  1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    47
    Vote Rating
    0
    mchambaud is on a distinguished road

      0  

    Post Panel onClick event

    Panel onClick event


    Hello

    I want to open a new Ext.Window() when the user clicks on a panel.. I used

    PHP Code:
    myPanel.on('click', function() {..}); 
    but it did not work... I looked in the docs and found that there's no public event click on a panel...

    I also tried this but it did not do anything.. tried several panel.event, none worked!...
    PHP Code:
           var myPanel = new Ext.Panel({
            
    html'foobar',
            
    baseCls'someClass',
            
    listeners: {
                
    activate: function(){
                    
    Ext.Msg.alert('test','test');              
                }
            }
        }); 
    How could I go around that?
    Any examples of working with panels and events? click events on panel?

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Browser events are available directly from DOM elements. So it's an element of the Panel that you want. That's header, body, footer, or getEl() for the overall element.

    Panels do not fire an activate event unless they are chldren of a TabPanel, and that TabPanel activates them.

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    And obviously the Panel has to be rendered before you can access its elements to add listsners...

  4. #4
    Sencha User
    Join Date
    Mar 2008
    Posts
    47
    Vote Rating
    0
    mchambaud is on a distinguished road

      0  

    Default


    any examples... I kinda lost lol

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    In your Ext examples/* directories. About 80 of them. Plus the Community Manual in the "Learn" section. Plus the API docs about Observable and Element.

  6. #6
    Sencha User
    Join Date
    Mar 2008
    Posts
    47
    Vote Rating
    0
    mchambaud is on a distinguished road

      0  

    Default


    Ok made it work thx!!!