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
onChange event
- Figure out if it's a
moveNodes event 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.
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:
onChangeeventmoveNodesevent and get the moved nodechildNode.childs[6].value = i + 1So 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.