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

Treeview Drag & Drop with constraint

1 Answer 332 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Sang
Top achievements
Rank 1
Sang asked on 09 Aug 2012, 09:21 PM
Hi Expert,
We are looking to use the Treeview Drag & Drop but would like to add some constraint, I am wondering if the current Kendo UI support what we're try to accomlish.
  • Can we limit the child level of the parent tree?  We want to only allow 1 child per parent?
  • Can we restrict user from creating the Top Level? 

We we try to accomplish is that we have a static list from the left hand side and we have 2 static parent on the right.  User must drag fromof the parent from the left.  The only condition is each of the level can only have 1 child node.
e.g.
Allow:
A
|---B
    |---C
        |---D
It cannot be where C&D is a child of B.  Can we prevent this?  TIA
A
|---B
    |---C
    |---D

Kendow UI Tree View 

1 Answer, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 10 Aug 2012, 02:15 PM
Hello Sang,

You can enforce these drag&drop constraints by handling the treeview drag&drop events, dragstart / drag / dropdragend. See the example code for the drag event for more information.

All the best,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Sang
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or