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

DnD from TreeView

3 Answers 163 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 15 Jun 2012, 04:22 AM
I am trying to get DnD to work from a TreeView to another component.  

How do I get the item from the TreeView on drop?  I have tried e.draggable, but I cannot find the item there.  
     
I have also tried calling $("treeview").data('kendoTreeView").select(), but it only returns the html and not the item.
This method also has the problem where if the item is dragged, but not selected, select returns nothing.

Thanks for the help.

Adam


3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 15 Jun 2012, 07:29 AM
You can access the source node through e.sourceNode.

Please refer to the documentation of the drop event -- it lists all available data and actions.

Kind regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Adam
Top achievements
Rank 1
answered on 15 Jun 2012, 04:23 PM
Thanks for the reply.  This gives me the <li>.  I need to find my object as stored in the datasource.  I can't search by text since nodes at different levels may have the same text.
0
Alex Gyoshev
Telerik team
answered on 18 Jun 2012, 06:00 AM

You can render the uids from the dataSource in hidden input fields using the treeview templates. You can then get the hidden input value and query the dataSource by uid.

We are currently working on tight integration between the dataSource and the treeview, which will be available with the Q2 beta that is due on June 21st. We encourage you to try it, and see if it satisfies your scenario.

All the best,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Drag and Drop
Asked by
Adam
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Adam
Top achievements
Rank 1
Share this question
or