Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tree JSON in UncontrolledEnvironment #184

Unanswered
eperrier asked this question in Q&A
Discussion options

Is there a quick way to return a JSON or array of the tree in an UncontrolledEnvironment once some event has occurred? I feel like this is obvious but cannot seem to find the answer. I'm using UncontrolledEnvironment because it's too time consuming to implement drag-and-drop functionality in ControlledEnvironment.

Essentially each time the tree changes, I want to extract a JSON of it (indeed just the items and their location) to save to a backend db.

I implemented a workaround using a custom data provider and extracting what I need from the onChangeItemChildren async but there must be a quicker way?

You must be logged in to vote

Replies: 1 comment

Comment options

When using an UncontrolledEnvironment, your approach of using a custom data provider and manually reacting to change-item-children events is the intended way. This library manages rendering the tree to the DOM and implementing user interactions, but managing the tree data is out of scope of this library and is up to the consumer.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /