开发者

Add Images to Flex Datagrid

开发者 https://www.devze.com 2023-02-14 02:17 出处:网络
I have a Datagrid that already gets its data from a data provider, there is a column 开发者_StackOverflow社区in the grid called priority. What i want to do is if the column priority contains the value

I have a Datagrid that already gets its data from a data provider, there is a column 开发者_StackOverflow社区in the grid called priority. What i want to do is if the column priority contains the value high then in an empty column in the datagrid i want to insert and image , the image being inserted depending on the value of the column priority.

Any help would be much appreciated.

thanks Chris


You could do this using an itemRenderer. Check out this link for an example. Here's another quick example:

<mx:DataGridColumn width="30" editable="false">
  <mx:itemRenderer>
    <fx:Component>
      <mx:Canvas horizontalScrollPolicy="off">
        <mx:Image id="myImage" x="11" source="{outerDocument.MyPriorityImage}" visible="{data.Priority > 50}" includeInLayout="{data.Priority > 50}"/>
      </mx:Canvas>
    </fx:Component>
  </mx:itemRenderer>
</mx:DataGridColumn>
0

精彩评论

暂无评论...
验证码 换一张
取 消