Hybrid View
-
7 Nov 2007 2:48 PM #1
[2.0rc1/2.0.1] TreePanel: Dropping onto a Leaf Node
[2.0rc1/2.0.1] TreePanel: Dropping onto a Leaf Node
Whenever any node is set as a leaf, you can't append nodes to it via drag+drop.
I think this must be a mistake since there are config options 'allowChildren' and 'allowDrop' to control such behavior.
Changing this line of Ext.tree.TreeDropZone in getDropPoint() (removing the isLeaf check) fixes it:
Code:var noAppend = tn.allowChildren === false || tn.isLeaf();
-
8 Nov 2007 3:24 AM #2
I think this is a bug also... I was almost putting it as a feature request..hope to see it fixed soon.
-
8 Nov 2007 3:29 AM #3
I don't think this is a bug. By declaring something as a leaf you're saying it can't have any children. If you want it to have a children, don't declare it as a leaf.
-
8 Nov 2007 3:54 AM #4
But on a dynamic tree you can't transform any non leaf nodes into a leaf node.
And that's not god..If a node doesn't have any children when its loaded that shouldn't mean it can't have any children always.
-
8 Nov 2007 4:00 AM #5
Just because the node is at the lowest level of the tree, doesn't necessarily make it a leaf. A leaf node is only created if you specify it in the config for the node. If there's the possibility data might be added under it, then don't specify that property.
-
9 Nov 2007 2:31 AM #6
If i remove all children from a node, dragging then to another node,it becomes a leaf and doesn't accept children any more...
-
5 Jan 2008 7:14 AM #7
for Ext 1.1.1 find in ext-all.js:
and replase on:var H=J.allowChildren===false||J.isLeaf();
var H=J.allowChildren===false;
-
8 Jan 2008 11:29 AM #8
great change, but how do you manage the icon?
great change, but how do you manage the icon?
If I add the following to my ext-all.js with the 1.1 version. My leaf does accept children however, the icon for the node remains a leaf and not a folder. Do you know how I would go about declaring the image of the said node to automatically have the folder icon?
var H=J.allowChildren===false;
-
28 Jan 2008 11:21 PM #9
我的办法是重载Ext.data.Node,添加一个setLeaf方法,然后在tree的append事件中把节点的leaf都设为false。
PHP Code:Ext.override(Ext.data.Node, {
setLeaf: function(value){
this.leaf = value;
}
});
欢迎加入37921608群(QQ)一起研讨Ext。PHP Code:this.on('append',function(tree,p,n,index){
n.setLeaf(false);
});


Reply With Quote