nyr_jack
Newbie

Posts: 31
|
 |
« on: October 29, 2012, 01:26:30 AM » |
|
Codes:
html: <ul id="basicTree" class="easyui-tree" style="height:200px;" data-options="url:'data/tree_data.json',checkbox:true,lines:true"></ul> <ul id="targetTree" class="easyui-tree" style="height:200px;" data-options="checkbox:true,lines:true"></ul>
javascripts:
var checkedNodes = $('#basicTree').tree('getChecked');
for(var i = 0; i < checkedNodes.length; i++){ //append every checked node to targetTree /* parentNode = $('#basicTree').tree('getParent',checkedNodes.target); var t_node = $('#targetTree').tree('find',parentNode.id); first problem is: there is no parent node of checkedNodes in targetTree, but when I use find method in targetTree , it can return node, it is wrong, how to solve? */ /* $('#targetTree').tree('append',{ parent:parentNode.target, data:[{ id:checkedNodes.id, text:checkedNodes.text }] });
it don't append this node to targetTree, but it append to basicTree. */ } Please help me ,it's hurry!
|