Copy the code code as follows:
//Just configure the viewConfig in the treepanel. If it is between two trees, both trees must be configured.
viewConfig:{
plugins :{
ptype:'treeviewdragdrop',
appendOnly:true//can only drag non-leaf nodes
},
listeners:{//Listener
drop:function(node,data,overModel,dropPosition,options){
//ajax operation synchronizes data to the background database
alert("Move:"+data.records[0].get('text')+" to:"+overModel.get("text"));
},
beforedrop:function(node,data,overModel,dropPosition,dropFunction,options){
//if(overModel.get("leaf")){//Target node
//overModel.set('leaf',false);
//}
}
}
}