Hi Joan I think the bug is cuased by a itemRenderer...

I'm using an ArrayCollection as the dataProvider.

This is the code for the datagrid:

<mx:DataGrid id="sessions_dg" dataProvider="{dataProvider}"
        width="90%" rowCount="5">       
        <mx:columns>
            <mx:DataGridColumn headerText="Descripción" dataField="title"/>
            <mx:DataGridColumn headerText="Autor" dataField="author" width="130"/>
            <mx:DataGridColumn headerText="Fecha Inicio" dataField="startDate" width="130" labelFunction="formatInitDate"/>
            <mx:DataGridColumn headerText="Estado" dataField="state"
                itemRenderer="sessions.view.itemRenderers.StateIconRenderer" width="55" resizable="false"/>
        </mx:columns>
    </mx:DataGrid>

if I remove the last column (the one with " sessions.view.itemRenderers.StateIconRenderer")
the grid  looks ok.

You can as well use height="100%" instead rowCount="5" to get a fix the layout bug

the itemrenderer is as follows:

<?xml version="1.0"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
    horizontalAlign="center" verticalAlign="middle">
   
    <mx:Image height="20" id="stateImage" toolTip="{tip}"/>
   
    <mx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
            import sessions.EmbededAssets;
           
            [Bindable]
            private var tip:String;
           
            override public function set data(value:Object):void {
               
                if(value != null) {
                    super.data = "">                   
                    var stateinfo:Object = EmbededAssets.getStateInfo(value.state);
                    stateImage.source = stateinfo.image;
                    tip = stateinfo.description;
                }
               
                dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
            }
           
            public function set wrapData(value:Number):void {
                data = "">            }
        ]]>
    </mx:Script>
</mx:VBox>

Basically the cell shows an icon with a tooltip...the icon seems the problem here

If you scroll all rows down, then the layout is fixed.

Hope that info helps.

C.


 
On 8/5/06, Joan Lafferty <[EMAIL PROTECTED]> wrote:

Hi Carlos,

 

Can you give us more details on the bug? What kind of dataProvider are you using. Or, just send us the code and we'll have a look. Is your DataGrid in a PopUp or custom component?

 

Thanks,

Joan

 

 


From: [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] On Behalf Of Carlos Rovira
Sent: Friday, August 04, 2006 2:09 PM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders] [Flex 2][Bug][DataGrid] rowCount=5 shows 6 rows

 

I'm experiencing a bug in DataGrid.

I set "rowCount" to 5 and the grid is showing 6 rows. The last one overflows datagrid's bottom line.

Someone knows how to fix this?

--
::| Carlos Rovira
::| http://www.carlosrovira.com




--
::| Carlos Rovira
::| http://www.carlosrovira.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




__,_._,___

Reply via email to