This is a migrated thread and some comments may be shown as answers.

Drag'n drop and load on demand

3 Answers 107 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
jorge
Top achievements
Rank 1
jorge asked on 17 Apr 2008, 01:26 PM

I am implementing drag and drop between trees (client side) and load on demand.  When droping a node with ExpandMode = ServerSideCallBack the new node on the destination tree has no + sign, but double clicking on the node loads the children.  Here is my clone function:

        function cloneNodeTree(node)  
        {  
              
            if (node.get_parent().get_value() != "Root")  
            {  
                cloneNodeTree(node.get_parent());  
            }  
            var destTree = $find("userTree");  
            if (destTree.findNodeByText(node.get_text()) == null)  
            {  
                var newNode = new Telerik.Web.UI.RadTreeNode();  
                newNode.set_text(node.get_text());    
                newNode.set_value(node.get_value());  
                if (node.get_attributes().getAttribute("groupID") != null)  
                {  
                    newNode.get_attributes().setAttribute("groupID", node.get_attributes().getAttribute("groupID"));  
                    newNode.get_nodes().clear();  
                    newNode.set_expandMode(2);  
                }  
                else 
                {  
                    newNode.get_attributes().setAttribute("layerID", node.get_attributes().getAttribute("layerID"));  
                    newNode.set_expandMode(0);  
                }  
                newNode.set_imageUrl(node.get_imageUrl());  
                //newNode.set_expandendImageUrl(node.get_expandedImageUrl());  
 
                  
                if (node.get_parent().get_value() == "Root")  
                {  
                    destTree.get_nodes().add(newNode);  
                }  
                else 
                {  
                    destTree.findNodeByText(node.get_parent().get_text()).get_nodes().add(newNode);  
                }  
             }  
        }  
 

What am I missing?

Jorge

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 18 Apr 2008, 04:14 PM
Hi jorge,

Could you also paste the code you use to drag and drop the nodes along with the treeview declaration. It would be best if you isolate the problem in a small and running project and attach the files to a new support thread.

Kind regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Rainz
Top achievements
Rank 1
answered on 18 May 2008, 02:49 PM
Also experiencing the same problem here.

Happens any time a serversidecallback node (that isn't yet expanded) is moved with client-side drag and drop.

The moved node loses its plus/expand symbol, but double-clicking still allows it to expand.

Thanks for any help you can provide
0
Veselin Vasilev
Telerik team
answered on 21 May 2008, 02:09 PM
Hello,

This appears to be a bug in the treeview.
We found a workaround until the fix is ready.
Please download the attached zip file and give it a try.

Kind regards,
Veskoni
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
jorge
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Rainz
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or