Wednesday, 11 July 2012

How to use Item Renderer in Flex

Item Renderer Is a greate feature provided by Flex. Using Item-Renderer you can Display Data In required manner. item-Renderer basically used with List Base Controls .i.e Data Grid, Combobox etc.
In addition to controlling the display of data using an item renderer, the DataGrid, List, and Tree controls let users edit the data. For example, you could let users update the Quantity column of a DataGrid control

In our Example we will see how to use renderers with
1)Use Item Renderer with Combobox.
2)use Item Renderer with DataGrid.

Like This You can also use it with different controls.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="" 
  xmlns:mx="library://" width="100%" height="100%" viewSourceURL="srcview/index.html">
<!-- Place non-visual elements (e.g., services, value objects) here -->
import mx.collections.ArrayCollection; 
[Bindable]public var _data:ArrayCollection = new ArrayCollection([{name:"Rabit",file:"a.gif"},
<mx:VBox width="100%" height="100%">
<mx:DataGrid dataProvider="{_data}" width="100%" height="50%">
<mx:DataGridColumn dataField="name" headerText="File Name"/>
<mx:DataGridColumn dataField="File">
<mx:Image width="100" height="100" source="{data.file}"/>
<mx:ComboBox dataProvider="{_data}" text="">
<mx:Image width="100" height="100" source="{data.file}"/>

No comments:

Post a Comment