Is there a way to ensure Clientside, that nodes have to exist above or below a node before they may be dropped?
example:
node a
---node a.1
------node a.1.1
node b
---node b.1
node c
node d
node a.1.1 may be dropped onto any node below it, but node c may not be dropped on any node but node d.
example:
node a
---node a.1
------node a.1.1
node b
---node b.1
node c
node d
node a.1.1 may be dropped onto any node below it, but node c may not be dropped on any node but node d.
6 Answers, 1 is accepted
0
Hi Shaunus,
You can use the OnClientNodeDropping property to set a client-side event handler. The event handler should check the target node and cancel the event by setting args.set_cancel(true);
I hope this helps.
Kind regards,
Erjan Gavalji
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can use the OnClientNodeDropping property to set a client-side event handler. The event handler should check the target node and cancel the event by setting args.set_cancel(true);
I hope this helps.
Kind regards,
Erjan Gavalji
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Shaunus
Top achievements
Rank 1
answered on 19 Jun 2008, 12:54 PM
Hi Erjan,
Thanks for your reply, however I am still unsure how to "check the target node" - whether it is below or above the source node in the tree.
Thanks for your reply, however I am still unsure how to "check the target node" - whether it is below or above the source node in the tree.
0
Hello Shaunus,
You can use the get_dropPosition() method of the event arguments to determine the position of the source node. Please refer to this help topic for more info.
Regards,
Albert
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can use the get_dropPosition() method of the event arguments to determine the position of the source node. Please refer to this help topic for more info.
Regards,
Albert
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Shaunus
Top achievements
Rank 1
answered on 23 Jun 2008, 02:54 PM
Hi Guys,
Please read my question carefully.
I am not dragging Nodes between eachother to identify whether they are below or above eachother. I am dragging Nodes on-top of eachother. This means I will always get a result of "over". Which still does not allow me to determine whether the Source Node is below or above the Destination Node.
How do I get around this?
In view of this, is there also a way to turn off "between Node dropping"?
Previously in your old treeview I noticed your nodes were identified by their parent nodes in an array delimited by an '|'. Which meant it Could just obtain the ID of the node and create my own functions. However your new structure does not have an ID of the same sort?
Please read my question carefully.
I am not dragging Nodes between eachother to identify whether they are below or above eachother. I am dragging Nodes on-top of eachother. This means I will always get a result of "over". Which still does not allow me to determine whether the Source Node is below or above the Destination Node.
How do I get around this?
In view of this, is there also a way to turn off "between Node dropping"?
Previously in your old treeview I noticed your nodes were identified by their parent nodes in an array delimited by an '|'. Which meant it Could just obtain the ID of the node and create my own functions. However your new structure does not have an ID of the same sort?
0
Hello Shaunus,
Drag and drop between nodes is disabled by default. You could use the following JavaScript code to check if a node is a child of another node:
if ($telerik.isDescendant(parentNode.get_element(), childNode.get_element())
{
//parentNode contains childNode
}
I hope this helps,
Albert
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Drag and drop between nodes is disabled by default. You could use the following JavaScript code to check if a node is a child of another node:
if ($telerik.isDescendant(parentNode.get_element(), childNode.get_element())
{
//parentNode contains childNode
}
I hope this helps,
Albert
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Shaunus
Top achievements
Rank 1
answered on 23 Jun 2008, 03:27 PM
Been running through your javascript. Seems like I could possibly use
"eventArgs.get_destNode()._getHierarchicalIndex()" and "eventArgs.get_sourceNode()._getHierarchicalIndex()" and compare the two. After all they are delimited by a ":" However I will look at your suggestion too.
Thanks.
"eventArgs.get_destNode()._getHierarchicalIndex()" and "eventArgs.get_sourceNode()._getHierarchicalIndex()" and compare the two. After all they are delimited by a ":" However I will look at your suggestion too.
Thanks.