-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
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:
- Capture the global
onChangeevent - Figure out if it's a
moveNodesevent and get the moved node - Set the value of a child node to an integer which represents the sort order:
childNode.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:
editor.content.removeChild(editor.table);
parentNode.expand();
editor.content.appendChild(editor.table);
Without success though..
Or update the DOM with editor.node._updateDomValue(). This would not work either.
Any advice will be greatly appreciated.