This question is locked. New answers and comments are not allowed.
Marco Teodoro
Top achievements
Rank 1
Marco Teodoro
asked on 09 Jun 2010, 03:11 PM
how can i make tree view undroppable.
i want ti drag from tree view and drop on a specific div, no inside tree view.
best regards
3 Answers, 1 is accepted
0
Hello Marco Teodoro,
Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
- attach an event handler to the nodeDragging event and deny the dragging of nodes over the treeview:
functiononNodeDragging(e) {if($(e.dropTarget).closest('.t-treeview').length > 0)e.setStatusClass('t-denied');} - prevent the default action of the nodeDrop event and handle the drops onto the div elements, like this:
functiononNodeDrop(e) {e.preventDefault();vardropContainer = $(e.dropTarget).closest('.drop-container');vartreeview = $('#TreeView').data('tTreeView');if(dropContainer.length > 0) {$('<div><strong>'+ treeview.getItemText(e.item) +'</strong></div>').hide().appendTo(dropContainer).slideDown('fast');}}
Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jronny
Top achievements
Rank 1
answered on 27 Aug 2010, 04:03 AM
Will this functionality be added to the next release?
0
Jon
Top achievements
Rank 1
answered on 23 Nov 2010, 10:10 PM
Should the following show the red circle with a line through it when dragging over the treeview control?
function onNodeDragging(e) {
if ($(e.dropTarget).closest('.t-treeview').length > 0)
e.setStatusClass('t-denied');
}
I'm using the Extensions for ASP.NET MVC Q3 2010 Live Examples (Win7, IE8 and FF3.6) with your attached drag-n-drop sample and I get the plus and insert inbetween icons when dragging over the treeview control.
It seems that the onNodeDragging function never gets called. If I insert an alert("hi"); before the if statement, I don't see the popup.
It does prevent dropping the node anywhere on the tree.
Thanks.