DenQ/list-to-tree

Does not work with strings as key_id and key_parent?

t-knapp opened this issue · 5 comments

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

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

Thanks.

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

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

For those interested, the old version can sort by strings