I was developing using kendo UI TreeList, however I found an issue when I drop a row from 1 parent to another, the source was not reparenting to the correct parent. Instead if was set to wrong position (as for my case it become a parent itself).
Step to reproduce:
Open this url https://dojo.telerik.com/UCUXaloN
Drag "Sprint planning (2012-2728)" and drop it to "Kick off" as per image below
After the drop the e.position should be "over" and I expect the row will appear inside "Kick Off" node and not as a parent itself. In the drop event after the "over" I will have my own logic to perform certain task.
Help is needed as I try with different and still not able to position it correctly.
Hi Kok Ho,
Regarding the issue with id being a string I would suggest you to take a look at the following issue logged in our GitHub repository:
Regarding the second issue for dropping a node as a first element, could you please elaborate a little bit more on the desired result? I have tested in the Dojo provided in your last reply and the nodes are ordered based on the position where a node is dropped. For example, if I drop a node right below the parent item and above the first child-node the dropped node will be rendered as first child. Could you please describe a little bit more the behavior you need to achieve.
Looking forward to your reply.
As for first issues, thanks for the link and I have change it accordingly by using number as mapping instead of string / guid and yes it work. May I know if there is any intention that it will be use to support more type?
And as for second issues, kindly use this code https://dojo.telerik.com/UCUXaloN/6, let's say that I would like to drag node "Grooming 2012-28" and drop it to another parent (e.position == "over") which is "Kick Off", after the drop, the node "Grooming 2012-28" it will always appear as last child node to the parent. Same goes if I drag and drop the same node "Grooming 2012-28" back to it original parent (in this case is "Sprint 2012-2728") it will still appear as the position before I drag
I have tested that in existing behavior it seem like has some cache on the old position of the node where if I drop it back to old parent it somehow get to the old position (which I wish to overwrite this behavior).
Therefore, in TreeList, is there a way that can I define whenever I drop a certain node, I would like it to be at a certain position (in my scenario always the first node does not matter it parent has child o sub child).
Example that whenever I drag and drop the node "Grooming 2012-28" to any other parent "Kick Off" or "Capacity planning", it would append or appear as the first child node. Perhaps something that look like this https://docs.devexpress.com/WindowsForms/DevExpress.XtraTreeList.TreeList.SetNodeIndex(DevExpress.XtraTreeList.Nodes.TreeListNode-System.Int32).
Can use the code snippet to provide any suggestion code if any
Regarding the issue in github - the issue will be reevaluated and depending on the result after that, we will consider if more types will be supported. Thus, currently, I could suggest to follow the item in Github.
Regarding changing the order of the dropped items I am afraid that currently such customization is not possible and changing the default order of the items when dragging and dropping is not recommended.
In case you have any additional questions on the matter, please let me know.
Can we set the default order to always the first one when dropping over to an element?
Hi Kok Ho,
Currently, the ListView does not provide a configuration option or method that will allow you to set the dropped item to be in the first place by default. Thus, I am afraid that for the item to be dropped at the first position it should be dropped when the 'insert' drag hint is displayed:
If it is suitable for your scenario, you could disable the dropping of items, when the position is 'over'.
Thanks for the info