2011-02-28 85 views
1

我有一個Datagrid已經從數據提供者獲取數據,在網格中有一列稱爲優先級。我想要做的是,如果列優先級包含高值,然後在我想要插入的數據網格和圖像的空列中插入圖像,這取決於列優先級的值。添加圖像到Flex Datagrid

任何幫助將不勝感激。

感謝 克里斯

回答

2

你可以做到這一點使用確定itemRenderer的。例如,請查看this link。這裏有另一個簡單的例子:

<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

感謝非常有幫助的工作完美 – Chris 2011-03-01 12:22:21