Answer the question
In order to leave comments, you need to log in
Getting json based on ul type list?
Hey!
There is a list of nodes of the following type .
It is necessary to run through it and get a list of id elements in json format, saving nesting in this format .
The id of only those elements that have the jstree-undetermine d and jstree-checked classes should get into the array .
I tried to solve the problem like this , but in my case, there is a duplication of nodes that do not have children. You need to get rid of duplicates, or avoid repetition from the very beginning.
Habr, tell me.
Answer the question
In order to leave comments, you need to log in
It is logical that the selector #id li
will give you the nodes not only of the current list, but also of all nested ones. So you should use #id>ul>li
, something like this: jsfiddle.net/DrqRu/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question