<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Opening branches by clicking rows in a Tree control in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 19:26:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: shaman4d</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-9487</link>
		<dc:creator>shaman4d</dc:creator>
		<pubDate>Tue, 09 Aug 2011 20:13:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-9487</guid>
		<description>Animation on opening and closing doesn&#039;t work. Could you help me?</description>
		<content:encoded><![CDATA[<p>Animation on opening and closing doesn&#8217;t work. Could you help me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elena</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-9177</link>
		<dc:creator>Elena</dc:creator>
		<pubDate>Fri, 29 Apr 2011 22:42:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-9177</guid>
		<description>Hi, very useful example indeed. 
I am a newbie so my question may sound stupid, what if you want to point to a specific object (aka folder) and not the whole tree?

Thanks.</description>
		<content:encoded><![CDATA[<p>Hi, very useful example indeed.<br />
I am a newbie so my question may sound stupid, what if you want to point to a specific object (aka folder) and not the whole tree?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-8937</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 31 Jan 2011 18:47:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-8937</guid>
		<description>Another great example!</description>
		<content:encoded><![CDATA[<p>Another great example!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bhargav</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-8559</link>
		<dc:creator>Bhargav</dc:creator>
		<pubDate>Sat, 13 Nov 2010 00:01:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-8559</guid>
		<description>Hey Vijay,
I understand this is a very old post for you. But I was trying to implement your idea for an ADG but in vain. 

Can you please explain your code or provide me a project file ofcorse alongwith the whole working code?

Bhargav</description>
		<content:encoded><![CDATA[<p>Hey Vijay,<br />
I understand this is a very old post for you. But I was trying to implement your idea for an ADG but in vain. </p>
<p>Can you please explain your code or provide me a project file ofcorse alongwith the whole working code?</p>
<p>Bhargav</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kubarium</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-8196</link>
		<dc:creator>kubarium</dc:creator>
		<pubDate>Wed, 04 Aug 2010 04:35:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-8196</guid>
		<description>Hi,

I have been trying the same trick for FileSystemTree in AIR but it does not work.

When I click on the row, I see the triangle looking down. I click again, it goes back to its initial position. I trace if the branch is open and get false/true so no problem there. However, the tree structure does not update itself. Moreover, if I happen to click on the triangle first, then everything works smoothly. There must be something about disclosure events, right?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have been trying the same trick for FileSystemTree in AIR but it does not work.</p>
<p>When I click on the row, I see the triangle looking down. I click again, it goes back to its initial position. I trace if the branch is open and get false/true so no problem there. However, the tree structure does not update itself. Moreover, if I happen to click on the triangle first, then everything works smoothly. There must be something about disclosure events, right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-8041</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Wed, 30 Jun 2010 22:15:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-8041</guid>
		<description>Could someone please help me, how do you get the depth of a node in an advanced Data grid.</description>
		<content:encoded><![CDATA[<p>Could someone please help me, how do you get the depth of a node in an advanced Data grid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-7186</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Sat, 06 Mar 2010 12:29:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-7186</guid>
		<description>Thank you very much for this example, it helped me optimise my own code!</description>
		<content:encoded><![CDATA[<p>Thank you very much for this example, it helped me optimise my own code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-3062</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 07 Jan 2009 12:13:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-3062</guid>
		<description>Hi,

Nice example. Can you explain how to display only the nodes we want ?

For example, in your XML, you have &quot;folder&quot; nodes and &quot;item&quot; nodes, and I would like to only show &quot;folder&quot; nodes.

Is it possible ?

Thanks,

Sam</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Nice example. Can you explain how to display only the nodes we want ?</p>
<p>For example, in your XML, you have &#8220;folder&#8221; nodes and &#8220;item&#8221; nodes, and I would like to only show &#8220;folder&#8221; nodes.</p>
<p>Is it possible ?</p>
<p>Thanks,</p>
<p>Sam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vijay Mareddy</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-3045</link>
		<dc:creator>Vijay Mareddy</dc:creator>
		<pubDate>Tue, 02 Dec 2008 15:30:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-3045</guid>
		<description>For ADG u need to use the ADGGroupItemRenderer:
&lt;pre class=&quot;code&quot;&gt;
public class MyAdvancedDataGridGroupItemRenderer extends AdvancedDataGridGroupItemRenderer {
    private var _listOwner:AdvancedDataGrid;
    private var _listData:AdvancedDataGridListData;

    public function MyAdvancedDataGridGroupItemRenderer(){
        super();
    }

    override public function set listData(value:BaseListData):void {
        super.listData = value;
        if (value) {
            _listData = value as AdvancedDataGridListData;
            _listOwner = value.owner as AdvancedDataGrid;

            label.addEventListener(MouseEvent.MOUSE_OVER,
                function(event:MouseEvent):void {
                    _listOwner.contextMenu = myContextMenu();
                    event.stopImmediatePropagation();
                });

            label.addEventListener(MouseEvent.MOUSE_OUT,
                function(event:MouseEvent):void {
                    _listOwner.contextMenu = null;
                    event.stopImmediatePropagation();
                });

            addEventListener( MouseEvent.CLICK,
                function(event:MouseEvent):void {
                    _listOwner.expandChildrenOf(_listData.item, !_listData.open);
                    event.stopImmediatePropagation();
                });
        }
    }

    private function myContextMenu():ContextMenu {
        var contextMenu:ContextMenu = new ContextMenu();
        contextMenu.hideBuiltInItems();

        var expandCollapseItem:ContextMenuItem = new ContextMenuItem(&quot;Expand/Collapse Item&quot;,false,true,true);
        expandCollapseItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
            function(event:ContextMenuEvent):void {
                _listOwner.expandItem( _listData.item, !_listData.open, false, false,null);
                event.stopImmediatePropagation();
            });
        contextMenu.customItems.push(expandCollapseItem);

        var expandCollapseChildrenOf:ContextMenuItem = new ContextMenuItem(&quot;Expand/Collapse Children Of&quot;,false,true,true);
        expandCollapseChildrenOf.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
            function(event:ContextMenuEvent):void {
                _listOwner.expandChildrenOf(_listData.item, !_listData.open);
                event.stopImmediatePropagation();
            });
        contextMenu.customItems.push(expandCollapseChildrenOf);
        /**
         *     collapseAll/expandAll  is causing
         *     Error #1502: A script has executed for
         *     longer than the default timeout period of 15 seconds.
         */
        //            var collapseAllMenuItem:ContextMenuItem = new ContextMenuItem(&quot;Collapse All Groups&quot;,true,true,true);
        //            collapseAllMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
        //                function(event:ContextMenuEvent):void {
        //                    _listOwner.collapseAll();
        //                });
        //            contextMenu.customItems.push(collapseAllMenuItem);
        //
        //            var expandAllMenuItem:ContextMenuItem = new ContextMenuItem(&quot;Expand All Groups&quot;,false,true,true);
        //            expandAllMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
        //                function(event:ContextMenuEvent):void {
        //                    _listOwner.expandAll();
        //                });
        //            contextMenu.customItems.push(expandAllMenuItem);

        return contextMenu;
    }
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>For ADG u need to use the ADGGroupItemRenderer:</p>
<pre class="code">
public class MyAdvancedDataGridGroupItemRenderer extends AdvancedDataGridGroupItemRenderer {
    private var _listOwner:AdvancedDataGrid;
    private var _listData:AdvancedDataGridListData;

    public function MyAdvancedDataGridGroupItemRenderer(){
        super();
    }

    override public function set listData(value:BaseListData):void {
        super.listData = value;
        if (value) {
            _listData = value as AdvancedDataGridListData;
            _listOwner = value.owner as AdvancedDataGrid;

            label.addEventListener(MouseEvent.MOUSE_OVER,
                function(event:MouseEvent):void {
                    _listOwner.contextMenu = myContextMenu();
                    event.stopImmediatePropagation();
                });

            label.addEventListener(MouseEvent.MOUSE_OUT,
                function(event:MouseEvent):void {
                    _listOwner.contextMenu = null;
                    event.stopImmediatePropagation();
                });

            addEventListener( MouseEvent.CLICK,
                function(event:MouseEvent):void {
                    _listOwner.expandChildrenOf(_listData.item, !_listData.open);
                    event.stopImmediatePropagation();
                });
        }
    }

    private function myContextMenu():ContextMenu {
        var contextMenu:ContextMenu = new ContextMenu();
        contextMenu.hideBuiltInItems();

        var expandCollapseItem:ContextMenuItem = new ContextMenuItem(&quot;Expand/Collapse Item&quot;,false,true,true);
        expandCollapseItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
            function(event:ContextMenuEvent):void {
                _listOwner.expandItem( _listData.item, !_listData.open, false, false,null);
                event.stopImmediatePropagation();
            });
        contextMenu.customItems.push(expandCollapseItem);

        var expandCollapseChildrenOf:ContextMenuItem = new ContextMenuItem(&quot;Expand/Collapse Children Of&quot;,false,true,true);
        expandCollapseChildrenOf.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
            function(event:ContextMenuEvent):void {
                _listOwner.expandChildrenOf(_listData.item, !_listData.open);
                event.stopImmediatePropagation();
            });
        contextMenu.customItems.push(expandCollapseChildrenOf);
        /**
         *     collapseAll/expandAll  is causing
         *     Error #1502: A script has executed for
         *     longer than the default timeout period of 15 seconds.
         */
        //            var collapseAllMenuItem:ContextMenuItem = new ContextMenuItem(&quot;Collapse All Groups&quot;,true,true,true);
        //            collapseAllMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
        //                function(event:ContextMenuEvent):void {
        //                    _listOwner.collapseAll();
        //                });
        //            contextMenu.customItems.push(collapseAllMenuItem);
        //
        //            var expandAllMenuItem:ContextMenuItem = new ContextMenuItem(&quot;Expand All Groups&quot;,false,true,true);
        //            expandAllMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
        //                function(event:ContextMenuEvent):void {
        //                    _listOwner.expandAll();
        //                });
        //            contextMenu.customItems.push(expandAllMenuItem);

        return contextMenu;
    }
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Senthil</title>
		<link>http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/comment-page-1/#comment-3054</link>
		<dc:creator>Senthil</dc:creator>
		<pubDate>Wed, 29 Oct 2008 13:04:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/05/opening-branches-by-clicking-rows-in-a-tree-control-in-flex/#comment-3054</guid>
		<description>How to get the exact value from a itemRollover event when using an advanced datagrid</description>
		<content:encoded><![CDATA[<p>How to get the exact value from a itemRollover event when using an advanced datagrid</p>
]]></content:encoded>
	</item>
</channel>
</rss>

