?
Solved

Not able to reduce DataGrid height from owner

Posted on 2011-03-25
3
Medium Priority
?
444 Views
Last Modified: 2012-05-11
Hello Expert,

I am using <mx:DataGrid/> in my component. Initially i put height=0, after calling server i am calculating height and i am increasing the height of DataGrid.There i am trying to decrease from owner height. But i am seeing no effect.

Please could you help me ?
public function set commandDetails(cmdDtls:CommandVO):void
if(cmdDtls.argumentList==null || cmdDtls.argumentList.length==0)
{
  argLbl.includeInLayout = false;
  argLbl.visible = false;
  dG.includeInLayout = false;
  dG.visible = false;
  moreDesc.includeInLayout = false;
  moreDesc.visible = false;
 //owner.height -= dGMaxHeight; 
}else
{
dG.includeInLayout = true;
dG.dataProvider = cmdDtls.argumentList;
var rows:int = cmdDtls.argumentList.length;
var calculatedHeight:int =dG.measureHeightOfItems(0,rows)+dG.headerHeight+2*rows;
if(calculatedHeight > dGMaxHeight)
{
     dG.height = dGMaxHeight;
     dG.rowCount = dG.rowCount - 1;
}
else
{
    dG.height = calculatedHeight;
    //owner.height -= (dGMaxHeight-dG.height)

}

}

<mx:DataGrid headerBackgroundSkin="@Embed(source='/assets/Panel_headerSkin.png')" id="dG" headerStyleName="datagridHeader"  width="675" height="0" variableRowHeight="true"
				  includeInLayout="false" >
			<mx:columns>
				<mx:DataGridColumn width="125" dataField="name" showDataTips="true" dataTipField="name" headerText="Argument Name" wordWrap="true"/>
				<mx:DataGridColumn id="argDesc" width="350" dataField="description" showDataTips="true" dataTipField="description" headerText="Argument Description" wordWrap="true"/>
				<mx:DataGridColumn width="200" dataField="dbRef" headerText="Argument DBRef" wordWrap="true"/>
			</mx:columns>
			</mx:DataGrid>

Open in new window

0
Comment
Question by:Alpita
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Expert Comment

by:dgofman
ID: 35219174
I don't know why you need to change the size if you can use includeInLayout, but anyway easist for you to use maxHeight

<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
				xmlns:s="library://ns.adobe.com/flex/spark" 
				xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<mx:DataGrid id="dG" dataProvider="[1,2,3,4,5,6,7,8,9]" width="675" height="100%" maxHeight="0" variableRowHeight="true"
			 includeInLayout="{dG.maxHeight != 0}" visible="{dG.maxHeight != 0}">
	<mx:columns>
		<mx:DataGridColumn width="125" dataField="name" showDataTips="true" dataTipField="name" headerText="Argument Name" wordWrap="true"/>
		<mx:DataGridColumn id="argDesc" width="350" dataField="description" showDataTips="true" dataTipField="description" headerText="Argument Description" wordWrap="true"/>
		<mx:DataGridColumn width="200" dataField="dbRef" headerText="Argument DBRef" wordWrap="true"/>
	</mx:columns>
</mx:DataGrid>
<mx:Button label="Full Size" click="dG.maxHeight = (dG.maxHeight == 0 ? NaN : 0)"/>
<mx:Button label="Fix Size" click="dG.maxHeight = (dG.maxHeight == 0 ? 300 : 0)"/>
</mx:Application>

Open in new window

0
 

Author Comment

by:Alpita
ID: 35403806
Hi Expert,

My App DataGrid is able to reduce the height by calling setTimeOut(setHeight,200) in onResult().

Thanks,
Alpita
0
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 total points
ID: 35410309
Ok, use maxHeight attribute it should work well for you
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
The top devops trends for 2017 are focused on improved deployment frequency, decreased lead time for change and decreased MTTR.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question