treejs icon indicating copy to clipboard operation
treejs copied to clipboard

'check' property not working as expected

Open pjdupreez opened this issue 2 years ago • 0 comments
trafficstars

I believe this to be a bug, but if not, please could you explain the correct use?

I get a collection of data (not through jstree ajax) which is in a flat form. Each datum has a Parent ID field which allows me to build a hierarchical structure from the data.

The first think I do, before building this structure is to map my data over into a structure that matches a treejs node stucture, and I also set the checked property based on some condition, ie

{ "id": datum.id, "text": datum.text, "checked": true, "children":[] }

When I do this, only nodes without children are set. Yet, when looking at the data for the nodes, all nodes have 'checked':true.

I can use the values option to set the checked nodes, but it is difficult to set nodes deeper than one level to checked, as i have to figure out the id path to that node first to check it, eg "3-3-6-1"

Any thoughts?

pjdupreez avatar Feb 03 '23 05:02 pjdupreez