如果:
html:
<divclass="easyui-tree"data-options="url:'tree_data1.json',method:'get',animate:true,dnd:true"></div>
js:
$('#rightTreePanel').tree({
height:100,
data: [{
text: 'Root',
id:'Root'
}],
//可以拖动
dnd:true,
animate:true,
onDrop: function(targetNode, source, point){
alert('滚');
}
});
结果为:
jquery.min.js:2 Uncaught TypeError: Cannot read property 'nodeName' of undefined 报错
修改方法:
将html的div标签改为ul标签就可以了
html:
<ulclass="easyui-tree"data-options="url:'tree_data1.json',method:'get',animate:true,dnd:true"></ul>