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

Drag And Drop to top level

3 Answers 131 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Emir Prcic
Top achievements
Rank 1
Emir Prcic asked on 14 Jun 2017, 06:42 AM

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.

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 15 Jun 2017, 03:20 PM
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.
0
Emir Prcic
Top achievements
Rank 1
answered on 16 Jun 2017, 05:23 AM
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.
0
Dimitar
Telerik team
answered on 19 Jun 2017, 08:49 AM
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.
Tags
TreeView
Asked by
Emir Prcic
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Emir Prcic
Top achievements
Rank 1
Share this question
or