-
17 Apr 2008 7:52 AM #1
Panel onClick event
Panel onClick event
Hello
I want to open a new Ext.Window() when the user clicks on a panel.. I used
but it did not work... I looked in the docs and found that there's no public event click on a panel...PHP Code:myPanel.on('click', function() {..});
I also tried this but it did not do anything.. tried several panel.event, none worked!...
How could I go around that?PHP Code:var myPanel = new Ext.Panel({
html: 'foobar',
baseCls: 'someClass',
listeners: {
activate: function(){
Ext.Msg.alert('test','test');
}
}
});
Any examples of working with panels and events? click events on panel?
-
17 Apr 2008 7:57 AM #2
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.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
17 Apr 2008 7:57 AM #3
And obviously the Panel has to be rendered before you can access its elements to add listsners...
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
17 Apr 2008 7:59 AM #4
-
17 Apr 2008 8:03 AM #5
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.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
17 Apr 2008 9:26 AM #6
-
11 Jun 2008 12:32 AM #7
-
17 Feb 2009 9:44 AM #8
-
19 Feb 2009 4:48 AM #9
hi finally i succed attaching a click event listener to a panel and this is an example :
var simple = new Ext.Panel({
frame:true,
defaultType:'label',
items: [
{text:'réf :'},
{text: 'famille :'},
{text: 'classmt :'}
],
listeners: {render: function(c) {c.body.on('click', function() { alert('onclick');});},
scope: this
}
});
-
5 Mar 2010 1:26 PM #10


Reply With Quote
thx!!!
