Results 1 to 2 of 2

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

  1. #1
    Sencha User
    Join Date
    Oct 2013
    Posts
    9
    Vote Rating
    0
      0  

    Default ext js4 - unable to load tree state when a node with subnode is minimzed

    I have created the below tree in Ext JS 4.

    Trer.PNG

    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

    Code:
    Ext.define('Example.view.SimpleTree', {  extend:'Ext.tree.Panel',
    
    
      height:500,
      width:500,
    
    
      title:'Simple Tree',
      viewConfig:{
    
    
        stateful:true, // Require
        stateId:'my_id', //Require, your tree id
    
    
        plugins:[ 'treestateful' ]
      },
    
    
      store:'SimpleTreeStore',
      renderTo:Ext.getBody()
    
    });


    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.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    504
      0  

    Default

    >> plugins:[ 'treestateful' ]

    Is this a 3rd party plugin?

    Scott

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •