Packageorg.openzet.controls.dataGridClasses
Classpublic class IconRenderer
InheritanceIconRenderer Inheritance mx.core.UIComponent
Implementsmx.controls.listClasses.IDropInListItemRenderer, mx.controls.listClasses.IListItemRenderer, mx.core.IDataRenderer

Custom itemRenderer class to display images for each file extension in a DataGrid.

View the examples.



Public Properties
 PropertyDefined by
  data : Object
IconRenderer
  listData : BaseListData
Implementation of IDropInListItemRenderer interface.
IconRenderer
Public Methods
 MethodDefined by
  
Constructor
IconRenderer
Protected Methods
 MethodDefined by
  
IconRenderer
Property detail
dataproperty
data:Object  [read-write]

Implementation
    public function get data():Object
    public function set data(value:Object):void
listDataproperty 
listData:BaseListData  [read-write]

Implementation of IDropInListItemRenderer interface.

Implementation
    public function get listData():BaseListData
    public function set listData(value:BaseListData):void
Constructor detail
IconRenderer()constructor
public function IconRenderer()

Constructor

Method detail
commitProperties()method
protected override function commitProperties():void

Examples
IconRendererExample
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    //--------------------------------------------------------------------------------
    //
    //  Imports
    //
    //--------------------------------------------------------------------------------
    import mx.collections.ArrayCollection;

    //--------------------------------------------------------------------------------
    //
    //  Variables
    //
    //--------------------------------------------------------------------------------
    // Sample Data..
    [Bindable]
    private var initDG:ArrayCollection = new ArrayCollection([
        {Artist:'Pavement', Album:'Slanted and Enchanted',
        Price:11.99, Sample: "FileName.doc"},
        {Artist:'Pavement', Album:'Slanted and Enchanted',
        Price:11.99, Sample: "FileName.kkk"},
        {Artist:'Pavement', Album:'Slanted and Enchanted',
        Price:11.99, Sample: "FileName.exe"},
        {Artist:'Pavement', Album:'Slanted and Enchanted',
        Price:11.99, Sample: "FileName.gif"},
        {Artist:'Pavement', Album:'Slanted and Enchanted',
        Price:11.99, Sample: "FileName.jpg"},
        {Artist:'Pavement', Album:'Slanted and Enchanted',
        Price:11.99, Sample: "FileName.ppt"},
        {Artist:'Pavement', Album:'Slanted and Enchanted',
        Price:11.99, Sample: "FileName.pdf"},
        {Artist:'Pavement', Album:'Brighten the Corners',
        Price:11.99, Sample: "" }]);

    //--------------------------------------------------------------------------------
    //
    //  Event Handlers
    //
    //--------------------------------------------------------------------------------
    private function init():void
    {
    }

    ]]>
    </mx:Script>

    <mx:Panel>
        <mx:DataGrid id="myGrid"
            width="400" height="280"
            dataProvider="{initDG}"
            variableRowHeight="true">
            <mx:columns>
                <mx:DataGridColumn dataField="Artist"/>
                <mx:DataGridColumn dataField="Sample"/>
                <mx:DataGridColumn width="50" dataField="Sample"
                    itemRenderer="org.openzet.controls.dataGridClasses.IconRenderer"/>
            </mx:columns>
        </mx:DataGrid>
    </mx:Panel>
</mx:Application>