A
A
ASiD2016-11-27 17:04:37
JavaScript
ASiD, 2016-11-27 17:04:37

How to get jstree content in alternative JSON format?

Hello. There is a jstree tree into which various elements are loaded. The user can perform various manipulations with them (rename, move, etc.). There is a "Record changes" button, for which I am currently writing a handler.
Tell me, how can I get the contents of jstree in an alternative json format (when dependencies are displayed not as a tree, but linearly. For example, id=..., parent=..., text=...)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ASiD, 2016-11-27
@ASiD

Found from foreign colleagues:

$('#tree').jstree(true).get_json('#', { flat : true})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question