Drag And Drop to top level

4 posts, 0 answers
  1. Emir Prcic
    Emir Prcic avatar
    27 posts
    Member since:
    Dec 2009

    Posted 14 Jun Link to this post

    I am using the treeview in Angularjs 1.5

    The treeview do not have a single Root node, but multiple Root nodes and i am trying to detect when i am dropping a node to the top level/Root without any luck.

    See attacheched image.

  2. Dimitar
    Admin
    Dimitar avatar
    172 posts

    Posted 15 Jun Link to this post

    Hello Emir,

    On the following Dojo example you will find a basic Kendo UI TreeView implementation in AngularJS, where a similar scenario to the one described is demonstrated.

    You will notice that in order to determine the drop target, I have used the TreeView's drop event as follows:
    $scope.onDrop = function(e) {        
      var dropTarget = e.dropTarget,                          
        dropTargetText = $(dropTarget).text();
     
        alert("Drop target text: " + dropTargetText);
    }

    You can use this event to verify if the drop target is equal to some expected value and then apply your custom logic depending on your application requirements.

    I hope this helps. In case you have any other questions related to the TreeView widget, please do not hesitate to contact us.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Emir Prcic
    Emir Prcic avatar
    27 posts
    Member since:
    Dec 2009

    Posted 16 Jun in reply to Dimitar Link to this post

    Maybe i explaimed my self not good enough. Related to the dojo, i am trying to drop and detect when i am dropping for example the Sofas node to the toplevel so it is on the same root level as Furniture and Decor. The issue is not being able to drop it there but to detect when it is on that level.. The content of the tree is completely dynamic so i can not use any text etc to determine the drop target. That i do in other ways.
  4. Dimitar
    Admin
    Dimitar avatar
    172 posts

    Posted 19 Jun Link to this post

    Hello Emir,

    The case seems rather complex and I will need more details in order to determine what is the best approach for the described scenario.

    Can you please provide an isolated example in the Dojo sanbox which reproduces the issue faced and send it back to us for a review? This way I will be able to troubleshoot the cause of the problem and provide you with further assistance.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top