View Full Version : ext js4 - unable to load tree state when a node with subnode is minimzed

19 Oct 2013, 10:34 PM
I have created the below tree in Ext JS 4.


The requirement is to save the tree state and load the same state after page is refreshed. So, if the user expands/collapses a particular node and then navigates to another page, when he comes back to this page, tree should be presented with the same nodes expanded or collapsed.

To do this I am using the below code, and it works fine

Ext.define('Example.view.SimpleTree', { extend:'Ext.tree.Panel',


title:'Simple Tree',

stateful:true, // Require
stateId:'my_id', //Require, your tree id

plugins:[ 'treestateful' ]



However there is one problem. If user were to collapse a node which has a subnode, then tree is not able to keep the state.
Example, in the tree above, if user were to collapse the 'Introduction' node (which has 'Address' as the sub node and Address is in expanded state), and then refresh the page, the state will not be saved. However, if the user were to first collapse 'Address' and then 'Introduction', it would work fine.

Can someone please provide some inputs as to what could be wrong here and how to fix this.

Thanks in anticipation.

21 Oct 2013, 1:08 PM
>> plugins:[ 'treestateful' ]

Is this a 3rd party plugin?