1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    Bangalore, India
    Posts
    176
    Answers
    4
    Vote Rating
    2
    renganathan is on a distinguished road

      0  

    Default Unanswered: Tree panel collapse all & expand all - problem

    Unanswered: Tree panel collapse all & expand all - problem


    Hi ,

    I am facing problem in tree panel collapse all and expand all.

    When the tree panel has less data , its working fine.

    When the tree panel has large date , its not working

    i am using this code to expand and collapse

    Code:
    treePanel.expandAll(); 
    treePanel.collapseAll();
    can you please help me to fix this problem?
    Thanks,

    RENGANATHAN M G

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Answers
    3540
    Vote Rating
    849
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Is all the data returned in one request or are you loading each node level when it is expanded?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Location
    Bangalore, India
    Posts
    176
    Answers
    4
    Vote Rating
    2
    renganathan is on a distinguished road

      0  

    Default Tree panel collapse all & expand all - problem

    Tree panel collapse all & expand all - problem


    For each node request is loading . By the way i am not calling each node, expandall() has the functionality


    Quote Originally Posted by mitchellsimoens View Post
    Is all the data returned in one request or are you loading each node level when it is expanded?
    Thanks,

    RENGANATHAN M G

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Answers
    3540
    Vote Rating
    849
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Ok but if you expand each node and a request is sent to get it's children, when you execute expandAll it doesn't know about those new children whenever they come back.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Sep 2011
    Posts
    7
    Vote Rating
    0
    xsba is on a distinguished road

      0  

    Default


    I have the same problem. We load whole tree in one request
    1. ExpandAll with the toolbar button
    2. Than collapseAll
    collapseAll_1.jpgexpandAll_1.jpg

  6. #6
    Sencha Premium Member
    Join Date
    Oct 2011
    Posts
    55
    Answers
    4
    Vote Rating
    0
    dwb is on a distinguished road

      0  

    Lightbulb Similar Problem: Node Expanded Causes Panel Depth Problem

    Similar Problem: Node Expanded Causes Panel Depth Problem


    Hey Gang,

    I'm experiencing a similar problem with treepanel nodes. The user can add folder nodes to the tree panel treepanel via a toolbar button. Nodes are added and the treepanel's depth adjust to each new node addition just fine. I was very pleased at this point.

    But, if a user adds a node to the tree when the parent node is collapsed, the depth of the treepanel doesn't seem to recalculate properly and the tree get cropped-off (image provided).

    nodes.jpg

    So, before I append the parent node with another child node, I check if the selected-child is visible. If it isn't, then this childnode must reside in a collapsed parent node. Ok, so, if this is the case, I expand the parent node and then add the new child node. Unfortunately, I get the same results as I did if I didn't expand the parent first.

    Here's a bit of code:

    //get the node that's currently selected
    var selModel = bpTree.getSelectionModel(); //treepanel selection manager
    var node = selModel.getLastSelected();

    //if node isn't visible, expand parent node before node addition
    if(!node.isVisible()){
    bpTree.setHeight(500);
    node.parentNode.expand();
    bpTree.doLayout();
    bpTree.show();
    //do add node stuff here...
    }

    Adding an extreme height value to the tree initially works, but, this is a hack approach that I wish to avoid. Is there a way to remove collapse property for the tree?

    Any ideas what gives here?


    Thanks!