Kendo Angular treeview drag and drop question

4 posts, 1 answers
  1. Donna Stewart
    Donna Stewart avatar
    127 posts
    Member since:
    Apr 2009

    Posted 30 Jul 2014 Link to this post

    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
  2. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 01 Aug 2014 Link to this post

    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!
     
  3. UI for ASP.NET AJAX banner
  4. Donna Stewart
    Donna Stewart avatar
    127 posts
    Member since:
    Apr 2009

    Posted 04 Aug 2014 in reply to Kiril Nikolov Link to this post

    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
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 05 Aug 2014 Link to this post

    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!
     
Back to Top
UI for ASP.NET AJAX banner