Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'check' property not working as expected #29

Open
pjdupreez opened this issue Feb 3, 2023 · 0 comments
Open

'check' property not working as expected #29

pjdupreez opened this issue Feb 3, 2023 · 0 comments

Comments

@pjdupreez
Copy link

pjdupreez commented Feb 3, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant