-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Update values in tree view programatically #271
Comments
Hi, this functionality is simply missing right now. You can only get/set the whole JSON object, and you can only get a notification that "something" changed but not what. @tomalec started implementing changesets a long time ago, see #102 and #136, but that was never finished. It's still on the wishlist though :). |
I actually got it working using Thanks anyways! |
Ah, ok. Great if that works for you. It's no public API so it may break some day in the future, but fine for now I think. |
For future googlers: |
@henkmollema how were you able to detect a change in the sort order? by reading here it looks like something like the following is possible... ?
|
Perhaps this is a stupid question, but I can't figure it out: how do I reflect changes to node values I made programatically in the tree view. My use-case is a following:
When a node within a certain array is moved, I want to update a property which represents the sort order of that object programatically.
Roughly the flow:
onChange
eventmoveNodes
event and get the moved nodechildNode.childs[6].value = i + 1
So far, so good. But the change is not reflected in the tree view. I could just call
editor.set(editor.get());
but that will cause the tree view to collapse.This leaves me with two options:
Either use above function and expand the node again, however I could not get this working. I tried:
Without success though..
Or update the DOM with
editor.node._updateDomValue()
. This would not work either.Any advice will be greatly appreciated.
The text was updated successfully, but these errors were encountered: