Is it possible to achieve drag & drop functionality of rows, similar to the TreeList in the ASP.NET AJAX control? If not, is there any way to move the order of the rows up or down (through API, etc)?
Thanks!
12 Answers, 1 is accepted
I am afraid that there is no drag&drop functionality in the Kendo UI TreeList at this time. You can submit this as a feature request on UserVoice. As for moving items with the API, you can do so via the DataSource insert and remove methods.
Regards,
Alex Gyoshev
Telerik
Hello Ivo,
I'm afraid not. The Gantt was released prior to the TreeList and contains a simpler implementation since it does not rely on most of the TreeList functionality (load on demand, locked columns).
Regards,Alex Gyoshev
Telerik
TreeList has an option edit: { move: true } which is drag and drop (within a single tree) but I can't for the life of me find the events for it in documentation or just fishing around. Edit, Save, and Change events don't fire on drop. Drop doesn't seem to be an event. Databound fires but there's no indication of the source or target nodes that I can see.
There had to have been some event included when this was added (apparently this 1st or 2nd quarter 2015). Without an event, I don't see how I could prevent an invalid drop. Sure - I can come up with around this by comparing some lookup to determine the changes, and then update the model... which may be what I have to do - but I'm hoping there's an event here somewhere.
Thanks for your help.
Jacques
Assuming your datasource isn't thousands of records, tracking this through the dataBound event was actually fairly painless by adding an original parent id field and looking for those with parentId not equal to originalParentId... running validation and reverting the change if needed, and then updating the originalParentId to the new validated parentId where validation was good. Convoluted, yes.
There is probably a simpler solution with an undocumented event.
J.
Hello Jacques,
Thank you for bringing this to our attention. I'm afraid that at this time, there are no drag&drop events. Since the implementation is shared with the TreeView, I am logging this as a feature request to provide the same events (dragstart/drag/drop/dragend) for a future release. Once implemented, you will be able to use the drop event to validate the drag operation.
Regards,Alex Gyoshev
Telerik
Thanks for the update Alex.
All the best.
J
Hello Craig,
The said feature is still pending implementation. Please note that the TreeList widget is not used in the Gantt widgets (both treelists are different and will require different code).
Regards,Alex Gyoshev
Telerik
Reordering of TreeList rows is not supported by the widget at this time, because it introduces a model requirement (the order id field). Feel free to suggest this on UserVoice to be considered for future implementation.
This thread has become a mixed conversation about drag&drop in the Gantt and TreeList, and further discussion becomes incoherent, so the thread is now locked.
Regards,Alex Gyoshev
Telerik by Progress