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

TreeView item with url property won't drag/drop

3 Answers 215 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 03 Feb 2017, 05:38 AM

If I remove the url property on the data item, behavior is normal.

I've got a jsFiddle that demonstrates the problem here. The last node, 'Carpets' has a url property and can't be dropped and won't fire the drag event.

3 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 06 Feb 2017, 02:03 PM
Hello Eric,

Currently the Drag and Drop functionality does not work for TreeView nodes that are set to navigate on click. As a workaround, you could consider using a conditional template, which will display a link if the node's purpose is to navigate and only its text if it is not. This way clicking on the link itself will navigate, but the node can still be dragged/dropped if you click on the span element that holds the anchor. Here's a sample dojo that demonstrates this approach. Note that I applied a CSS rule that makes the span element mentioned above wider so that it is easier to click on it (instead of on the link it wraps) and drag it.

Regards,
Ivan Danchev
Telerik by Progress
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
Eric
Top achievements
Rank 1
answered on 07 Feb 2017, 01:32 AM
Thanks Ivan. That work great.
0
Ivan Danchev
Telerik team
answered on 08 Feb 2017, 01:52 PM
Hello Eric,

Thank you for getting back to us. I am glad the suggested approach that uses templates worked out.

Regards,
Ivan Danchev
Telerik by Progress
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
Drag and Drop
Asked by
Eric
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Eric
Top achievements
Rank 1
Share this question
or