-
18 Mar 2012 8:54 PM #1
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
can you please help me to fix this problem?Code:treePanel.expandAll(); treePanel.collapseAll();
-
19 Mar 2012 8:10 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
- Answers
- 3105
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
19 Mar 2012 8:52 PM #3
Tree panel collapse all & expand all - problem
-
20 Mar 2012 4:40 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
- Answers
- 3105
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
22 Mar 2012 5:50 AM #5
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
-
23 Mar 2012 9:06 AM #6
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!


Reply With Quote