<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: AutoSizingAdvancedDataGrid that fixes the variableRowHeight issues with mx.controls.AdvancedDataGrid</title>
	<atom:link href="http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/feed/" rel="self" type="application/rss+xml" />
	<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 22 Sep 2009 16:42:19 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Terry</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-470</link>
		<dc:creator>Terry</dc:creator>
		<pubDate>Tue, 22 Sep 2009 16:42:19 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-470</guid>
		<description>Me again.   I&#039;ve implemented this solution and it definitely works, however for large result sets I&#039;m losing the default styling on the ADG. i.e. No alternating row colors, no skins on the headers, etc.  Any suggestions?</description>
		<content:encoded><![CDATA[<p>Me again.   I&#8217;ve implemented this solution and it definitely works, however for large result sets I&#8217;m losing the default styling on the ADG. i.e. No alternating row colors, no skins on the headers, etc.  Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Terry</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-469</link>
		<dc:creator>Terry</dc:creator>
		<pubDate>Tue, 22 Sep 2009 14:18:53 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-469</guid>
		<description>Hello,  can&#039;t find the definition of DEFAULT_MAX_HEIGHT.</description>
		<content:encoded><![CDATA[<p>Hello,  can&#8217;t find the definition of DEFAULT_MAX_HEIGHT.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rik</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-409</link>
		<dc:creator>Rik</dc:creator>
		<pubDate>Tue, 24 Feb 2009 09:11:17 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-409</guid>
		<description>@13. Derek - January 22, 2009

Hi derek.. could you please give us a working example of your code hint

Many thanks</description>
		<content:encoded><![CDATA[<p>@13. Derek &#8211; January 22, 2009</p>
<p>Hi derek.. could you please give us a working example of your code hint</p>
<p>Many thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-401</link>
		<dc:creator>Derek</dc:creator>
		<pubDate>Thu, 22 Jan 2009 22:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-401</guid>
		<description>I found a suitable solution where I didn&#039;t even need to use this class. &#039;terminates_report_panel_g&#039; and &#039;quota_report_panel_g&#039; are ADGs stored in local MXML files.

1.) set your data
2.) set a local variable this.total_rows = YOUR_DATA.length;// this gets the amount of rows at depth 1

For HierarchalData, do the following:
3.) Set an event handler for your event with code similar to this:
var new_height:Number;
				
				if (a.itemRenderer != null) {
					if (a.type == AdvancedDataGridEvent.ITEM_OPEN) { // Item is opening
						this.total_rows++;
					}
					else { // Item is closing
						this.total_rows--;
					}
				}
				terminates_report_panel_g.rowCount = this.total_rows;				
				new_height = terminates_report_panel_g.measureHeightOfItems(0, terminates_report_panel_g.rowCount);
				new_height += terminates_report_panel_g.headerHeight;
				
				// Finalize the heights
				terminates_report_panel_g.height = new_height;
				this.height = new_height + app_panel.borderMetrics.top + app_panel.borderMetrics.bottom;

FOR SIMPLE ARRAYCOLLECTION DATA, do the following:
3.) Set an event handler for your event with code similar to this:
var new_height:Number;
				
				if (a.itemRenderer != null) {
					var item:IListItemRenderer = a.itemRenderer;
					if (a.type == AdvancedDataGridEvent.ITEM_OPEN) { // Item is opening
						this.total_rows += item.data.children.length;	
					}
					else { // Item is closing
						this.total_rows -= item.data.children.length;
					}
				}
				quota_report_panel_g.rowCount = this.total_rows;
				
				// Show all groupLabels by default, plus all the rows under each open group
				var num_visible_rows:int = quota_report_panel_g.gc.grouping.fields.length + quota_report_panel_g.rowCount;
				
				new_height = quota_report_panel_g.measureHeightOfItems(0, num_visible_rows);
				new_height += quota_report_panel_g.headerHeight;
				
				if (quota_report_panel_g.gc.summaries != null) {
					new_height += quota_report_panel_g.rowHeight;
				}
				
				// Finalize the heights
				quota_report_panel_g.height = new_height;
				this.height = new_height + app_panel.borderMetrics.top + app_panel.borderMetrics.bottom;</description>
		<content:encoded><![CDATA[<p>I found a suitable solution where I didn&#8217;t even need to use this class. &#8216;terminates_report_panel_g&#8217; and &#8216;quota_report_panel_g&#8217; are ADGs stored in local MXML files.</p>
<p>1.) set your data<br />
2.) set a local variable this.total_rows = YOUR_DATA.length;// this gets the amount of rows at depth 1</p>
<p>For HierarchalData, do the following:<br />
3.) Set an event handler for your event with code similar to this:<br />
var new_height:Number;</p>
<p>				if (a.itemRenderer != null) {<br />
					if (a.type == AdvancedDataGridEvent.ITEM_OPEN) { // Item is opening<br />
						this.total_rows++;<br />
					}<br />
					else { // Item is closing<br />
						this.total_rows&#8211;;<br />
					}<br />
				}<br />
				terminates_report_panel_g.rowCount = this.total_rows;<br />
				new_height = terminates_report_panel_g.measureHeightOfItems(0, terminates_report_panel_g.rowCount);<br />
				new_height += terminates_report_panel_g.headerHeight;</p>
<p>				// Finalize the heights<br />
				terminates_report_panel_g.height = new_height;<br />
				this.height = new_height + app_panel.borderMetrics.top + app_panel.borderMetrics.bottom;</p>
<p>FOR SIMPLE ARRAYCOLLECTION DATA, do the following:<br />
3.) Set an event handler for your event with code similar to this:<br />
var new_height:Number;</p>
<p>				if (a.itemRenderer != null) {<br />
					var item:IListItemRenderer = a.itemRenderer;<br />
					if (a.type == AdvancedDataGridEvent.ITEM_OPEN) { // Item is opening<br />
						this.total_rows += item.data.children.length;<br />
					}<br />
					else { // Item is closing<br />
						this.total_rows -= item.data.children.length;<br />
					}<br />
				}<br />
				quota_report_panel_g.rowCount = this.total_rows;</p>
<p>				// Show all groupLabels by default, plus all the rows under each open group<br />
				var num_visible_rows:int = quota_report_panel_g.gc.grouping.fields.length + quota_report_panel_g.rowCount;</p>
<p>				new_height = quota_report_panel_g.measureHeightOfItems(0, num_visible_rows);<br />
				new_height += quota_report_panel_g.headerHeight;</p>
<p>				if (quota_report_panel_g.gc.summaries != null) {<br />
					new_height += quota_report_panel_g.rowHeight;<br />
				}</p>
<p>				// Finalize the heights<br />
				quota_report_panel_g.height = new_height;<br />
				this.height = new_height + app_panel.borderMetrics.top + app_panel.borderMetrics.bottom;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-400</link>
		<dc:creator>Derek</dc:creator>
		<pubDate>Mon, 05 Jan 2009 15:00:47 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-400</guid>
		<description>Sorry, to expand on how it&#039;s not correctly resizing, it&#039;s cutting off the bottom of the grid, as if it can&#039;t be bothered to render anything above the number of itemRenderers originally visible or something</description>
		<content:encoded><![CDATA[<p>Sorry, to expand on how it&#8217;s not correctly resizing, it&#8217;s cutting off the bottom of the grid, as if it can&#8217;t be bothered to render anything above the number of itemRenderers originally visible or something</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-399</link>
		<dc:creator>Derek</dc:creator>
		<pubDate>Mon, 05 Jan 2009 14:54:33 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-399</guid>
		<description>khurram, I definitely tried all those solutions. The problem is that when the the user triggers AdvancedDataGridEvent.ITEM_OPEN, my app is not resizing correctly. I&#039;m using this function to re-size my app (&#039;this&#039; refers to the Application object, xml_data is a heirarchal data structure):

private function changeAppHeight(a:AdvancedDataGridEvent):void {
				if (a.type == AdvancedDataGridEvent.ITEM_OPEN) { // Item is opening
					terminates_report_panel_g.height = terminates_report_panel_g.measureHeightOfItems(-1, xml_data.length) + terminates_report_panel_g.headerHeight;
				}
				else { // Item is closing
					terminates_report_panel_g.height = terminates_report_panel_g.measureHeightOfItems(-1, xml_data.length) + terminates_report_panel_g.headerHeight;
				}
				this.height = terminates_report_panel_g.height + app_panel.borderMetrics.top + app_panel.borderMetrics.bottom;
				if (ExternalInterface.available) {
					try {
						ExternalInterface.call(&quot;EC.Project_Reports.setReportHeight&quot;, this.height);
					}catch (error:SecurityError) {
	                    //output.appendText(&quot;A SecurityError occurred: &quot; + error.message + &quot;\n&quot;);
	                }catch (error:Error) {
	                    //output.appendText(&quot;An Error occurred: &quot; + error.message + &quot;\n&quot;);
	                }
				}
			}</description>
		<content:encoded><![CDATA[<p>khurram, I definitely tried all those solutions. The problem is that when the the user triggers AdvancedDataGridEvent.ITEM_OPEN, my app is not resizing correctly. I&#8217;m using this function to re-size my app (&#8216;this&#8217; refers to the Application object, xml_data is a heirarchal data structure):</p>
<p>private function changeAppHeight(a:AdvancedDataGridEvent):void {<br />
				if (a.type == AdvancedDataGridEvent.ITEM_OPEN) { // Item is opening<br />
					terminates_report_panel_g.height = terminates_report_panel_g.measureHeightOfItems(-1, xml_data.length) + terminates_report_panel_g.headerHeight;<br />
				}<br />
				else { // Item is closing<br />
					terminates_report_panel_g.height = terminates_report_panel_g.measureHeightOfItems(-1, xml_data.length) + terminates_report_panel_g.headerHeight;<br />
				}<br />
				this.height = terminates_report_panel_g.height + app_panel.borderMetrics.top + app_panel.borderMetrics.bottom;<br />
				if (ExternalInterface.available) {<br />
					try {<br />
						ExternalInterface.call(&#8220;EC.Project_Reports.setReportHeight&#8221;, this.height);<br />
					}catch (error:SecurityError) {<br />
	                    //output.appendText(&#8220;A SecurityError occurred: &#8221; + error.message + &#8220;\n&#8221;);<br />
	                }catch (error:Error) {<br />
	                    //output.appendText(&#8220;An Error occurred: &#8221; + error.message + &#8220;\n&#8221;);<br />
	                }<br />
				}<br />
			}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: khurram</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-398</link>
		<dc:creator>khurram</dc:creator>
		<pubDate>Fri, 02 Jan 2009 23:28:48 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-398</guid>
		<description>Nikos,  the code should work for you for custom itemRenderers too.  I have used it with custom renderers and that was a primary requirement for this piece of code anyway.  Could you please be more specific about the issue you are seeing?</description>
		<content:encoded><![CDATA[<p>Nikos,  the code should work for you for custom itemRenderers too.  I have used it with custom renderers and that was a primary requirement for this piece of code anyway.  Could you please be more specific about the issue you are seeing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: khurram</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-397</link>
		<dc:creator>khurram</dc:creator>
		<pubDate>Fri, 02 Jan 2009 23:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-397</guid>
		<description>Derek, you can get rid of the logic that checks for maxHeight inside the measureHeight method.  Or you can specify a maxHeight that is a very large number. Also if you never want to see scrollbars on your grid, set horizontalScrollPolicy and verticalScrollPolicy to false.  Lemme know how ti goes.</description>
		<content:encoded><![CDATA[<p>Derek, you can get rid of the logic that checks for maxHeight inside the measureHeight method.  Or you can specify a maxHeight that is a very large number. Also if you never want to see scrollbars on your grid, set horizontalScrollPolicy and verticalScrollPolicy to false.  Lemme know how ti goes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-396</link>
		<dc:creator>Derek</dc:creator>
		<pubDate>Fri, 02 Jan 2009 21:42:06 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-396</guid>
		<description>I have need of this, but the version provided is not behaving the way I need it to. Is there a way to make the new grid expand to the full height of its sub-components, including setting the .height property of the grid in question when its done? The way it is now it still shows scrollbars. I need an accurate height so I can re-size the application itself. any scroll bars need to be in the HTML browser itself.

my setup:

1.) panel surrounding ADG
2.) ADG which has hierarchal data. column 1 is just text, column 2 is a custom renderer which has 2 columns, both of which use another custom renderer. all custom renderers are ADG&#039;s themselves.
3.) when user clicks on column 1 text, it should open up column 2 (which physically sits below it and spans the same length as the text) and re-size the entire grid to fit. It does this but then adds scrollbars.</description>
		<content:encoded><![CDATA[<p>I have need of this, but the version provided is not behaving the way I need it to. Is there a way to make the new grid expand to the full height of its sub-components, including setting the .height property of the grid in question when its done? The way it is now it still shows scrollbars. I need an accurate height so I can re-size the application itself. any scroll bars need to be in the HTML browser itself.</p>
<p>my setup:</p>
<p>1.) panel surrounding ADG<br />
2.) ADG which has hierarchal data. column 1 is just text, column 2 is a custom renderer which has 2 columns, both of which use another custom renderer. all custom renderers are ADG&#8217;s themselves.<br />
3.) when user clicks on column 1 text, it should open up column 2 (which physically sits below it and spans the same length as the text) and re-size the entire grid to fit. It does this but then adds scrollbars.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Facundo</title>
		<link>http://workdayui.wordpress.com/2008/05/09/autosizingadvanceddatagrid-that-fixes-the-variablerowheight-issues-with-mxcontrolsadvanceddatagrid/#comment-395</link>
		<dc:creator>Facundo</dc:creator>
		<pubDate>Wed, 10 Dec 2008 20:52:09 +0000</pubDate>
		<guid isPermaLink="false">http://workdayui.wordpress.com/?p=15#comment-395</guid>
		<description>Thanks a lot! it works perfect! AdvancedDataGrid is enough poor..</description>
		<content:encoded><![CDATA[<p>Thanks a lot! it works perfect! AdvancedDataGrid is enough poor..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
