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

Treelist drag and drop behave like treeview?

5 Answers 103 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Nayana
Top achievements
Rank 1
Nayana asked on 09 Dec 2016, 04:29 AM

Hello,

 

Is there a way i can override default tree list drag and drop event? 

I would need similar functionality as tree view where i can order the rows and insert before or after any row.

Any help would be appreciated.

 

 

Thanks in advance!

5 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 12 Dec 2016, 10:46 AM
Hi Nayana,

The TreeList widget does not support reordering out of the box. The behavior you are after could be implemented though, by subscribing to the widget's drag and drop events and doing the reordering manually if the conditions are met. 

Regards,
Alexander Popov
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
Nayana
Top achievements
Rank 1
answered on 13 Dec 2016, 05:44 AM

Hello,

Thanks for the reply.

In Treeview, there is a property called "dropPosition" which i can set in drop / dragend event.

In TreeList, there is a property called "position" which i can set in drop / dragend event. It is not having any impact on setting the position property to value "before" / "after".

 

Can you please help me with a code snippet on how i can achieve the same in tree list?

 

 

Thanks in advance!

0
Nayana
Top achievements
Rank 1
answered on 13 Dec 2016, 06:00 AM

Hello,

Thanks for the reply.

In Tree view, the dragend and drop event have a property called "dropPosition".
Where as in tree list, the same events have a property called "position". I tried setting the position value to "before" / "after". It has no impact.

Can you please help me with the code snippet on how i can achieve the same in tree list?

I also see, there is a cue line in tree view, when i drag rows. They indicate the position where i can insert the dragged row. How can i have the same cue line in tree list?

Attached is the snapshot of the line in tree view. 





0
Nayana
Top achievements
Rank 1
answered on 13 Dec 2016, 06:01 AM
Hello,

Thanks for the reply.

In Tree view, the dragend and drop event have a property called "dropPosition".
Where as in tree list, the same events have a property called "position". I tried setting the position value to "before" / "after". It has no impact.

Can you please help me with the code snippet on how i can achieve the same in tree list?

I also see, there is a cue line in tree view, when i drag rows. They indicate the position where i can insert the dragged row. How can i have the same cue line in tree list?

Attached is the snapshot of the line.




0
Alexander Popov
Telerik team
answered on 14 Dec 2016, 10:51 AM
Hello,

As mentioned previously, reordering is not supported out of the box. This means that deciding how and when to show the cue and the before/after cursor icons should be part of the custom implementation. Changing the order of the items can be achieved using the DataSource's API methods.

Regards,
Alexander Popov
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
TreeList
Asked by
Nayana
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Nayana
Top achievements
Rank 1
Share this question
or