EasyUI Forum
September 13, 2025, 02:09:55 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: Copy node between trees on: December 22, 2014, 09:52:43 AM
@jarry

Thanks very much. That solved the issue.
2  General Category / EasyUI for jQuery / Re: Copy node between trees on: December 21, 2014, 02:43:00 AM
Providing minimal working example

Code:
<ul id="groupstree" class="easyui-tree tree" data-options="animate:true,dnd:true,
  onBeforeDrop: function(target,source,point){

    if( source.attributes.source == 'person_tree' ){

      toAppend = source;
      toAppend.attributes.source = 'big_tree';

      $(this).tree('append',
      {
parent: target,
data: toAppend,
      });

      return false;
    }
     
  },
  onAfterEdit: function(e, node) {
      editName(e);
    },   
  data:[
  {'id':37,'text':'Group','attributes':{'node_type':'group','source':'big_tree'},'children':[{'id':-1,'text':'People','attributes':{'node_type':'people','source':'big_tree'},'state':'closed','children':[{'id':155,'text':'foo bar (foobar)','attributes':{'node_type':'person','source':'big_tree'}},{'id':157,'text':'test test (test)','attributes':{'node_type':'person','source':'big_tree'}},{'id':5,'text':'foo1 bar1','attributes':{'node_type':'person','source':'big_tree'}},]}]},
 
    ]
"></ul>
<div class="collections">
<ul id="peopletree" class="easyui-tree tree" data-options="animate:true,dnd:true,
  onDragEnter: function(target,source){
    if(source.attributes.source != null )
      return false;
  },
  data:[
  {'id':187,'text':'malenki asd (malenki)','attributes':{'node_type':'person','edited':false,'source':'person_tree'},'checked':'true'},{'id':160,'text':'asdfsadf asfasdfsa (sdfasdf)','attributes':{'node_type':'person','edited':false,'source':'person_tree'},'checked':'true'}, 
    ]
"></ul>
[code]
[/code]
3  General Category / EasyUI for jQuery / Copy node between trees on: December 19, 2014, 02:27:09 AM
I try to copy, a node between two trees by means of dnd. The target tree has a onBeforeDrop method declared, which appends a new node with data copied from the source and returns false. However when i try to repeat the copy procedure on the node used previously copied node I got error:
_db is null
source is null

I assume that it is because 'return false' only affects the target tree, not source tree. Any ideas how to over come this?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!