Carina
12 Jul 2007, 11:41 PM
hi,
just a small thing...
I want to listen to the node expand event of a TreePanel. "expand" and "expandnode" don't work. Instead I have to listen for "expandexpandnode" - is this intended?
Example:
Tree = Ext.tree;
var tree = new Tree.TreePanel("test", {
animate:true,
enableDD:true,
containerScroll: true,
rootVisible:false
});
var root = new Tree.TreeNode({
text: 'Albums',
allowDrag:false,
allowDrop:false
});
tree.setRootNode(root);
root.appendChild(
new Tree.TreeNode({text:'Album 1', cls:'album-node', allowDrag:false}),
new Tree.TreeNode({text:'Album 2', cls:'album-node', allowDrag:false}),
new Tree.TreeNode({text:'Album 3', cls:'album-node', allowDrag:false})
);
tree.render();
root.expand();
tree.on('expandexpandnode', function() {
alert("expandexpandnode fired (1)!");
}, tree);
tree.on('expandnode', function() {
alert("expandnode fired (2)!");
}, tree);
tree.on('expand', function() {
alert("expand fired (3)!");
}, tree);
results in:
alert("expandexpandnode fired (1)!");
Browser: Firefox on Mac,
Ext 2.0, rev. 702, YUI adapter
(sorry if this has already been fixed in SVN, I don't update more than once a week).
just a small thing...
I want to listen to the node expand event of a TreePanel. "expand" and "expandnode" don't work. Instead I have to listen for "expandexpandnode" - is this intended?
Example:
Tree = Ext.tree;
var tree = new Tree.TreePanel("test", {
animate:true,
enableDD:true,
containerScroll: true,
rootVisible:false
});
var root = new Tree.TreeNode({
text: 'Albums',
allowDrag:false,
allowDrop:false
});
tree.setRootNode(root);
root.appendChild(
new Tree.TreeNode({text:'Album 1', cls:'album-node', allowDrag:false}),
new Tree.TreeNode({text:'Album 2', cls:'album-node', allowDrag:false}),
new Tree.TreeNode({text:'Album 3', cls:'album-node', allowDrag:false})
);
tree.render();
root.expand();
tree.on('expandexpandnode', function() {
alert("expandexpandnode fired (1)!");
}, tree);
tree.on('expandnode', function() {
alert("expandnode fired (2)!");
}, tree);
tree.on('expand', function() {
alert("expand fired (3)!");
}, tree);
results in:
alert("expandexpandnode fired (1)!");
Browser: Firefox on Mac,
Ext 2.0, rev. 702, YUI adapter
(sorry if this has already been fixed in SVN, I don't update more than once a week).