Have you tried something like:
enabled="{(data.pagecount != 0)? true:false}"
Tracy
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of oneproofdk
Sent: Tuesday, September 04, 2007 7:30 AM
To: [email protected]
Subject: [flexcoders] DataGrid ItemRenderes - How to use AS to select
the state
I'ce created a MXML ItemRenderer used in a dg - the cell contains a
Button that spawns a new window - works fine.
In my dataset I have an item called "pagecount" containing a integer.
What I'd like to do, is to have the buttons enabled=false when that
value == 0 !!
I just cant make it work - can someone please help or provide
links/examples for this ??
<mx:DataGrid x="0" y="0" id="dgProjects" width="100%" height="100%"
backgroundColor="#FFFFFF" rowHeight="22">
<mx:columns>
<mx:DataGridColumn width="30" textAlign="center" headerText="PDF"
itemRenderer="dg_pdficon"/>
<mx:DataGridColumn headerText="Orderid" dataField="orderid" width="80"/>
<mx:DataGridColumn headerText="Jobnavn" dataField="jobnavn"
width="250"/>
<mx:DataGridColumn headerText="Kunde" dataField="kundenavn"
width="200"/>
<mx:DataGridColumn headerText=""/>
</mx:columns>
</mx:DataGrid>
Itemrenderer : dg_pdficon
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox clipContent="false" xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
xmlns:flexlib="http://code.google.com/p/flexlib/
<http://code.google.com/p/flexlib/> ">
<flexlib:CanvasButton enabled="true" buttonMode="true"
useHandCursor="true" verticalCenter="1" horizontalCenter="1"
width="25" height="20" click="parentDocument.showAlert(data.orderid)">
<mx:HBox id="hb" height="100%" width="100%" verticalGap="0"
verticalAlign="middle" horizontalAlign="center">
<mx:Image id="btn" source="@Embed(source='assets/pdf_16.png')"
mouseOver="parentDocument.showThumb(data.orderid, data.pagecount);"
mouseOut="parentDocument.removeThumb();"/>
</mx:HBox>
</flexlib:CanvasButton>
</mx:HBox>
Thanks for any help!
Mark