Open simonssspirit opened 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.
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.
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.
Is this still the expected? I have ids with guid and works fine to me, should I be worried?
We have not applied any changes to the logic in regards of the above scenario. That said I suggest using numbers as ids.
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
.
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