Results 1 to 10 of 13

Thread: Panel onClick event

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    47
    Vote Rating
    0
      0  

    Post 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,615
    Vote Rating
    54
      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,615
    Vote Rating
    54
      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
      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,615
    Vote Rating
    54
      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
      0  

    Default

    Ok made it work thx!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •