PDA

View Full Version : [CLOSED]Tree panel +/- toggle does not fire click event



catapult
25 May 2010, 1:19 AM
Ext version tested:


Ext 3.2 rev 1
Adapter used:


ext
css used:


only default ext-all.css
Browser versions tested against:


IE8.0.6001.18702
FF3.5.9 (firebug 1.5.4 installed)
Safari 4.0.4(531.21.10)
Opera 10.53 build 3374
Google Chrome 4.1.249.1064 (45376)
Operating System:


WinXP Pro
Description:


Tree panel +/- toggle does not fire click event. Clicking anywhere along a nodes row, except on the toggle, causes the click event to be fired.
Test Case:



/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.onReady(function(){
// shorthand
var Tree = Ext.tree;
var tree = new Tree.TreePanel({
useArrows: true,
autoScroll: true,
animate: true,
enableDD: true,
containerScroll: true,
border: false,
// auto create TreeLoader
dataUrl: 'get-nodes.php',
root: {
nodeType: 'async',
text: 'Ext JS',
draggable: false,
id: 'src'
},
listeners : {
click : function(n){
console.log('clicked');
}
}
});
// render the tree
tree.render('tree-div');
tree.getRootNode().expand();
});


Steps to reproduce the problem:


Copy tree panel example from extjs examples.
Add a click listener to tree panel.
Load in some nodes.
Click along a nodes row.
Notice when the click event is fired.
The result that was expected:


Click anywhere along a nodes row, except the toggle, and the click event is fired.
Click a nodes toggle and the click event is not fired.
http://www.extjs.com/forum/showthread.php?100011-Click-event-on-Tree-Panel

evant
25 May 2010, 1:31 AM
This is by design and I think that behaviour makes sense. Collapse/Expand is really a different operation and listeners are provided for that.