Results 1 to 6 of 6

Thread: Treepanel issue

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    55

    Default Treepanel issue

    Hi,
    Treepanel root and childs not rendering in second time. First time its working fine.

    Please suggest what is the issue on it.

    Thanks in Advance

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409

    Default

    You will need to provide more details. Possible issue:
    -destroying object, then trying to call it again

    Scott.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    55

    Default

    Hi,

    I am trying like this


    Ext.getCmp(

    'treeId').setRootNode(rfaTree);


    Ext.getCmp(

    'treeId').removeAll();


    Ext.getCmp(
    'treeId').setRootNode(rfaTree);

    Bt its not working..

    Please help me to solve this issue.

    Thanks in Advance

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409

    Default

    What is the error message in the console? As mentioned, you are not providing much detail.

    Scott.

  5. #5
    Sencha Premium Member tempvalue's Avatar
    Join Date
    Apr 2012
    Location
    Nyon
    Posts
    25

    Default

    There was a different approach when clearing a treestore. You may need to add the following properties into your treestore:
    set clearOnLoad = false

    To clear your treestore, instead of removeAll you can call:
    this.fireEvent('clear',this);

    For more details check the link below:
    http://tempvalue.blogspot.com/2012/0...d-problem.html

  6. #6
    Sencha Premium Member tempvalue's Avatar
    Join Date
    Apr 2012
    Location
    Nyon
    Posts
    25

    Default

    I thing loading data into treestore is a bit different than store. You can try the following solution.
    1)In treestore config add clearOnLoad : false in config.
    2)If you want to clear all items, you can call: this.fireEvent('clear',this);

    I also realize that when you create a treestore but not a treepanel(since whenever treepanel is initialized its store is automatically called) and try to call treestore load() method, it is loaded twice. You should also consider this when loading data.

    Check my blog post for further information:
    http://tempvalue.blogspot.com/2012/04/ext-js-4-treestore-load-problem.html

Posting Permissions

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