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

Kendo Angular treeview drag and drop question

3 Answers 165 Views
Integration with other JS libraries
This is a migrated thread and some comments may be shown as answers.
Donna Stewart
Top achievements
Rank 1
Donna Stewart asked on 30 Jul 2014, 03:36 PM
I have two treeviews, I would like to drag from the first one to the second one as a child of one of the nodes in the second treeview.  I want to keep the node in the first treeview (drag and copy).  I have tried several things and can't seem to get it right.  I am trying not to access any DOM elements in my controller, so figuring out the code to append the dragged node as a child to one of the nodes in the second treeview is escaping me.  I have a simplified version of what i'm trying in the dojo - http://dojo.telerik.com/EluY/2

Any help is very much appreciated!

Thanks,
Donna

3 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 01 Aug 2014, 08:32 AM
Hi Donna,

The problem comes from the fact that you do not pass a $scope parameter to your controller and therefore the userTreeDrop event is not attached to the $scope and the TreeView k-options attribute. Please also keep in mind that "data-k-data-source" attributes are not generally supported, they might work in your case, but it is not the recommended approach.  Please check an example that I created showing the functionality that you look for:

http://dojo.telerik.com/ubarA

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Donna Stewart
Top achievements
Rank 1
answered on 04 Aug 2014, 06:28 PM
Your snippet was exactly what I needed!  Thank you!  Just an FYI, I was using the controller as syntax, so I actually did have things in scope, just had gone down the wrong road trying to use parentNode.  Here's my corrected snippet that works - http://dojo.telerik.com/EluY/6

Thanks so much for your help!
Donna
0
Kiril Nikolov
Telerik team
answered on 05 Aug 2014, 06:43 AM
Hi Donna,

I am happy to hear that the example was helpful.

In case you have any further questions, please do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Integration with other JS libraries
Asked by
Donna Stewart
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Donna Stewart
Top achievements
Rank 1
Share this question
or