DenQ / list-to-tree

Convert list to tree
BSD 3-Clause "New" or "Revised" License
87 stars 30 forks source link

Does not work with strings as key_id and key_parent? #18

Closed t-knapp closed 6 years ago

t-knapp commented 6 years ago

It seems, links / references do not work with string values. Is this on purpose? Are there are some reasons?

`const list = [ { _id: "EL", parentId: 0 }, { _id: 2, parentId: "EL" }, { _id: 3, parentId: "EL" } ];

getTree() { const llt = new LLT(list, { key_id: '_id', key_parent: 'parentId' }); return llt.GetTree(); }`

Lib just gives warnings: 2018-06-22_165825

DenQ commented 6 years ago

Hello @t-knapp . Sorry, I was very busy. Yes, string id, do not support. Can be in future. Thanks.

t-knapp commented 6 years ago

Thanks.

karlitos commented 6 years ago

Any news on that ? Seems to be like a quite important feature.

NickStees commented 5 years ago

Second the vote on this is useful!! Need to have parent and id's as strings not just integers

NickStees commented 5 years ago

For those interested, the old version can sort by strings