I know repeater will allow for different heights of the items, but have
had this problem myself and have no ready solution.  

 

Calculating the height is tough, because of the wordWrap.  Perhaps there
is a property you could use, like measuredHeight, that you could use to
set the height explicitly.  Timing this calc / set will be an issue.

 

What happens if you set the rowCount to the number of rows in each
item's dataProvider?

 

Just brainstorming a bit.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Steven
Sent: Tuesday, March 25, 2008 12:40 PM
To: [email protected]
Subject: [flexcoders] Heights of repeated datagrids

 

Still trying to figure out how to control the heights of datagrids in a
repeated custom component.

 

If I do not set the height of the datagrid then all repeated datagrids
seem to acquire a height which is the height necessary to display the
largest amount of data. Therefore I end up with some data grids that
only have one row of data with HUGE amounts of empty space in them. 

 

If I do set the height of the datagrid to 100% then each datagrid takes
on a height of 100% of the custom component height. Therefore I end up
with vertical scrollbars.

 

I basically want to have each repeated datagrid display all its rows of
data without using any vertical scrollbar.

 

Here is the relevant code of my custom component

 

Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="600">

            <mx:DataGrid x="20" y="36"  showHeaders="false" width="525"
id="markSheetSectionDG" wordWrap="true" variableRowHeight="true"
editable="true" dataProvider="{markSheet10DGDataAC}" height="100%">

                        <mx:columns>

                                    

                                    <mx:DataGridColumn headerText=""
dataField="blockTitle" editable="false" />


                    

            <mx:DataGridColumn dataField="blockMark" 

                itemRenderer="mx.controls.CheckBox" 

                rendererIsEditor="true" 

                editorDataField="selected" headerText="" editable="true"
width="50" />

             

                        </mx:columns>

            </mx:DataGrid>

            <mx:Text text="{_xmlItem.subTitle}" x="20" y="10"
id="subTitle" fontWeight="bold"/>

 

 

This problem is something that affects several areas of my application
so it would be great to find a solution.

 

Thanks

 

Paul

 

p.s the following is the code in my main mxml file that displays the
repeated custom component

 

<mx:VBox width="720" height="190" id="markSheetTile">

                                                

<mx:Repeater id="markSheet10NewRepeater"
dataProvider="{this.markSheet10XMLData}" >


<local:MarkSheet10Item  id="markSheet10NewItem"
xmlItem="{markSheet10NewRepeater.currentItem}">

</local:MarkSheet10Item>

</mx:Repeater>         

</mx:VBox>

 

 

 

Reply via email to