tree dragdrop: node properties - Ext JS

本文讨论了如何使用 YUI-Ext 框架中树形控件的拖放功能,并提供了如何获取拖动节点属性的具体代码示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

tree.on('beforenodedrop', function(node) {
	alert(node.target.attributes.cls);
});
With node.target.attributes I can access the target properties of the node. But how can I access the properties of the node I drag and drop? I really can't find this in the documentation.
Reply With Quote
  #2  
Old 03-12-2007, 08:02 AM
Default

It's mentioned in the documentation: http://www.yui-ext.com/deploy/ext-1....beforenodedrop

Code sample:
tree.on("beforenodedrop", function(dropEvent){
    Ext.dump(dropEvent.dropNode.attributes);
});
Reply With Quote
  #3  
Old 03-12-2007, 08:08 AM
Default

Thx s6urik, apparently I still have problems to find the information in the documentation that I need.

I'm very sorry for this question, but to say it in Dutch: "Al doende leert men" (or in English: "learning by doing")
Reply With Quote
  #4  
Old 03-14-2007, 03:18 PM
Default

if you create a node like so:
var node = new Ext.tree.TreeNode({
	        text: 'Node Text',
	        id:'nodeID',
		object: 'root',
                foo: 'foo attribute',
                bar: 'bar attribute',
        	leaf: false
});
you can access each attribute as
    alert(node.attributes.foo);
    alert(node.attributes.bar);
    alert(node.attributes.object);
    //etc
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值