<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
    layout="absolute" 
    viewSourceURL="srcview/index.html"
    creationComplete="onCreationComplete()">


    <!--
     * This is a example application which demonstrates how
     * custom item renderers can be used to apply effects to individual
     * cells when the user mouses over them, rather than just to the
     * entire row.
     *
     * Author: Tony Fendall
     * Date: 05/03/2009
     -->
     
     
    <mx:Style source="styles.css" />   

    
    <mx:Script>
        <![CDATA[
            
            private function onCreationComplete():void
            {
                // Generate example data
                var data:Array = [];
                for(var i:int=0; i<40; i++)
                {
                    data.push({column1:Math.random(),column2:Math.random(),column3:Math.random(),column4:Math.random(),column5:Math.random()});
                }
                dataGrid.dataProvider = data;
            }
        ]]>
    </mx:Script>
    


    <mx:Panel title="Custom Cell Emphasis" left="10" right="10" top="10" bottom="10" >
    
    
    <!-- DataGrid with custom item renderers applied (also has default row rollover highlight turned off) -->
        <mx:DataGrid id="dataGrid" width="100%" height="100%" useRollOver="false" selectable="false" >
            <mx:columns>
            
            <!-- DataGrid columns with background changing item renderers -->    
                <mx:DataGridColumn headerText="Column 1" dataField="column1" itemRenderer="itemRenderers.RollOverItemRenderer"/>
                <mx:DataGridColumn headerText="Column 2" dataField="column2" itemRenderer="itemRenderers.RollOverItemRenderer"/>
                <mx:DataGridColumn headerText="Column 3" dataField="column3" itemRenderer="itemRenderers.RollOverItemRenderer"/>
                <mx:DataGridColumn headerText="Column 4" dataField="column4" itemRenderer="itemRenderers.RollOverItemRenderer"/>
                <mx:DataGridColumn headerText="Column 5" dataField="column5" itemRenderer="itemRenderers.RollOverItemRenderer"/>
    
            </mx:columns>
        </mx:DataGrid>
    </mx:Panel>
    
    
    
    
    <!-- Application Control Bar -->     
    <mx:ApplicationControlBar dock="true">
        <mx:Label text="Cell" styleName="headderText"/>        
        <mx:Spacer width="-20" />        
        <mx:Label text="Roll Over" styleName="headderTextBlue"/>
        <mx:Label text="Example" styleName="headderText"/>
        <mx:Script>
            <![CDATA[ import flash.net.navigateToURL; ]]>
        </mx:Script>
        <mx:LinkButton label="created by Tony Fendall" color="#FFFFFF" click="{navigateToURL( new URLRequest('http://www.munkiihouse.com'))}" />
    </mx:ApplicationControlBar>

</mx:Application>