A
A
Arthur Koch2012-05-28 11:39:34
JavaScript
Arthur Koch, 2012-05-28 11:39:34

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

1 answer(s)
S
Sergey Leshchina, 2012-05-28
@dudeonthehorse

It is logical that the selector #id liwill 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 question

Ask a Question

731 491 924 answers to any question