[flexcoders] Expand all items of a tree
Hi, in flex2b3, I could open all nodes of my tree by doing this: treeTest.selectedIndex = 0; treeTest.expandChildrenOf(treeTest.selectedItem, true); Unfortunately, this isnt working anymore. I tried treeTest.expandItem(treeData.node[0],true, false); , teeTest.expandChildrenOf(treeTest.firstVisibleItem), but no luck. Who helps? Jonas __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
RE: [flexcoders] Expand all items of a tree
Sorry to bump this, but Im desperately looking for a solution.. Jonas From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jonas Windey Sent: woensdag 28 juni 2006 12:01 To: flexcoders@yahoogroups.com Subject: [flexcoders] Expand all items of a tree Hi, in flex2b3, I could open all nodes of my tree by doing this: treeTest.selectedIndex = 0; treeTest.expandChildrenOf(treeTest.selectedItem, true); Unfortunately, this isnt working anymore. I tried treeTest.expandItem(treeData.node[0],true, false); , teeTest.expandChildrenOf(treeTest.firstVisibleItem), but no luck. Who helps? Jonas __ NOD32 1.1629 (20060628) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
RE: [flexcoders] Expand all items of a tree
Its working for me. Heres an example. Im not sure what you are wanting to do, but in this example you have to select a tree item, then click the Expand All button. You can modify it as desired. ?xml version=1.0 encoding=utf-8? !-- Tree control example. -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml mx:Script ![CDATA[ [Bindable] public var selectedNode:Object; // Event handler for the Tree control change event. public function treeChanged(event:Event):void { selectedNode=Tree(event.target).selectedItem; } private function expand():void { myTree.expandChildrenOf(myTree.selectedItem, true); } ]] /mx:Script mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ /node node label=Spam/ node label=Sent/ /node /mx:XMLList mx:Tree id=myTree width=427 height=410 labelField=@label showRoot=false dataProvider={treeData} change=treeChanged(event)/ mx:Button label=Expand all click=expand()/ /mx:Application From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Jonas Windey Sent: Wednesday, June 28, 2006 7:31 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Expand all items of a tree Sorry to bump this, but Im desperately looking for a solution.. Jonas From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Jonas Windey Sent: woensdag 28 juni 2006 12:01 To: flexcoders@yahoogroups.com Subject: [flexcoders] Expand all items of a tree Hi, in flex2b3, I could open all nodes of my tree by doing this: treeTest.selectedIndex = 0; treeTest.expandChildrenOf(treeTest.selectedItem, true); Unfortunately, this isnt working anymore. I tried treeTest.expandItem(treeData.node[0],true, false); , teeTest.expandChildrenOf(treeTest.firstVisibleItem), but no luck. Who helps? Jonas __ NOD32 1.1629 (20060628) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
RE: [flexcoders] Expand all items of a tree
Yes, I have gotten so far too. The problem is I want to open the items directly, without a user clicking on something. Before I could just set myTree.selectedIndex to 0, and after that myTree.expandChildrenOf(myTree.selectedItem, true); But after debugging, I found that if you set the selectedIndex to 0, it doesnt set the selectedItem, it stays null until a user clicks on a node. I should be able to trigger it without doing that, but I cant find it Help! :-) From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mac Martine Sent: woensdag 28 juni 2006 17:38 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Expand all items of a tree Its working for me. Heres an example. Im not sure what you are wanting to do, but in this example you have to select a tree item, then click the Expand All button. You can modify it as desired. ?xml version=1.0 encoding=utf-8? !-- Tree control example. -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml mx:Script ![CDATA[ [Bindable] public var selectedNode:Object; // Event handler for the Tree control change event. public function treeChanged(event:Event):void { selectedNode=Tree(event.target).selectedItem; } private function expand():void { myTree.expandChildrenOf(myTree.selectedItem, true); } ]] /mx:Script mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ /node node label=Spam/ node label=Sent/ /node /mx:XMLList mx:Tree id=myTree width=427 height=410 labelField=@label showRoot=false dataProvider={treeData} change=treeChanged(event)/ mx:Button label=Expand all click=expand()/ /mx:Application From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Jonas Windey Sent: Wednesday, June 28, 2006 7:31 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Expand all items of a tree Sorry to bump this, but Im desperately looking for a solution.. Jonas From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Jonas Windey Sent: woensdag 28 juni 2006 12:01 To: flexcoders@yahoogroups.com Subject: [flexcoders] Expand all items of a tree Hi, in flex2b3, I could open all nodes of my tree by doing this: treeTest.selectedIndex = 0; treeTest.expandChildrenOf(treeTest.selectedItem, true); Unfortunately, this isnt working anymore. I tried treeTest.expandItem(treeData.node[0],true, false); , teeTest.expandChildrenOf(treeTest.firstVisibleItem), but no luck. Who helps? Jonas __ NOD32 1.1629 (20060628) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com __ NOD32 1.1630 (20060628) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] Expand all items of a tree
Seems to work for me. If you change the code for expand() in Martine's example to : private function expand():void { myTree.selectedIndex = 0; myTree.expandChildrenOf(myTree.selectedItem , true); }It works without clicking on the tree first...-- davidMany people die at twenty five and aren't buried until they are seventy five. - Benjamin Franklin __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___