getTreeState, setTreeState

Use getTreeState to store and restore the state of the model tree. The state includes the visibility of items, collapsed and expanded branches of the tree, and the current selection.

Demo 1
  1. Check or uncheck items in the model tree to show or hide them.

  2. Click to get the current tree state.
    The state appears in the option list below. (Doesn't work yet)

  3. Select a state to restore from the option list:

  4. Repeat to get more tree states.

Tree states appear as entries in this option list. Click an entry to restore the tree state: