telerik / kendo-ui-core

An HTML5, jQuery-based widget library for building modern web apps.
http://www.telerik.com/kendo-ui
Other
2.54k stars 1.9k forks source link

TreeList drag and drop functionality does not work when the Ids are stings(guids). #3142

Open simonssspirit opened 7 years ago

simonssspirit commented 7 years ago

Bug report

TreeList drag and drop functionality does not work when the Ids are stings (guids).

Reproduction of the problem

The issue can be observed in the following Dojo: http://dojo.telerik.com/eQuJA

Environment

ag-petrov commented 7 years ago

The described behavior is expexted. The treelist model expect a number for the parentId field and if such is not provided the widget will not be able to correctly set the parent id when drop is performed. In cases where string are used as ids our logic will try to parse them, that is why the scenario where the ids are number strings works. In order to avoid inconsistencies I suggest using numbers as ids.

vdachev commented 7 years ago

The treelist model expect a number for the parentId field

I don't seem to find a mention of this in the documentation. Moreover, I found a forum post that literally says:

... the TreeList should work fine with string type for the Id and the parent id properties.

ag-petrov commented 7 years ago

Indeed the TreeList should work fine when the Id and ParendId are strings however these strings should contain numbers so they can be parsed. Please accept our apologies for the misleading post.

As for the documentation we will soon update it in order to avoid such confusion in future.

guylhermetabosa commented 6 years ago

Is this still the expected? I have ids with guid and works fine to me, should I be worried?

ag-petrov commented 6 years ago

We have not applied any changes to the logic in regards of the above scenario. That said I suggest using numbers as ids.

vdachev commented 3 years ago

Is there a particular reason the TreeList uses as IDs? We have objects that are identified by their GUIDs (e.g. Active Directory entries) that we need to show in a tree. We have to generate numeric IDs and keep a mapping just to show them on a TreeList.