It's just a basic mxml component based on box.
Am I better doing this as a custom component in Actionscript?
again thanks.

<?xml version="1.0" encoding="utf-8"?>
<mx:Box xmlns:mx="http://www.adobe.com/2006/mxml"; width="100%"
height="100%" backgroundColor="{bgColor}">
<mx:Script>
<![CDATA[
import com.pbsmedia.ccAdmin.vo.ContactVO;
                        
private var _contact:ContactVO;
[Bindable]
private var bgColor:int = BASE_COLOR;
private static const INACTIVE_COLOR:int = 0xcf19b3;
private static const NO_CALL_COLOR:int= 0xFF0000;
private static const APPOINTMENT_MADE_COLOR:int = 0x1800ff;
private static const BASE_COLOR:int = 0xFFFFFF
                        
override public function set data(value:Object):void{
        if(value != null){
        this._contact = value as ContactVO;
        if(_contact.ContactInactive == 1){
        bgColor = INACTIVE_COLOR;
        this.toolTip = "Contact Inactive"
        }else if(_contact.ContactNC == 1){
        bgColor = NO_CALL_COLOR;
        this.toolTip = "Do not call"
        }else if(_contact.ContactAppointment == 1){
        bgColor = APPOINTMENT_MADE_COLOR;
        this.toolTip = "Appointment made"
        }else{
        bgColor = BASE_COLOR;
        this.toolTip = null}}}

                ]]>
        </mx:Script>
</mx:Box>



--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> What does the renderer look like?  Why does it need focus?
> 
>  
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Barry
> Sent: Friday, June 27, 2008 4:17 PM
> To: [email protected]
> Subject: [flexcoders] Re: Datagrid Weirdness - Lose arrow key
> functionality
> 
>  
> 
> Thanks Alex,
> Any idea how to stop that happening? I've set the dataColumn's enabled
> property to false hoping that would do it but have had no joy.
> 
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > If you renderer steals focus, DG arrows will stop working.
> > 
> > 
> > 
> > ________________________________
> > 
> > From: [email protected] <mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of Barry
> > Sent: Friday, June 27, 2008 5:34 AM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Datagrid Weirdness - Lose arrow key
> functionality
> > 
> > 
> > 
> > Hi,
> > Can anyone help me out here?
> > I have a datagrid which when using the up and down arrow keys changed
> > the selected index of the grid. All normal there.
> > However, when I add an itemRenderer to one of the dataGrid Columns, I
> > lose that functionality.
> > 
> > <mx:DataGrid x="0" y="40" width="100%" height="100%" id="lisDG"
> > dataProvider="{model.contactObjects}" change="dataGridClick(event)">
> > <mx:columns>
> > <mx:DataGridColumn width="20" 
> > itemRenderer="com.pbsmedia.ccAdmin.comps.StatusRenderer" 
> > editable="false"/>
> > <mx:DataGridColumn width="40" sortDescending="true" sortable="true"
> > sortCompareFunction="Sorts.compareRegDate" headerText="Reg Date"
> > labelFunction="Sorts.doRegDateLabel"/>
> > <mx:DataGridColumn width="40" sortable="true"
> > headerText="Associate" dataField="ContactAssociate"/>
> > <mx:DataGridColumn width="100" sortable="true" headerText="Name"
> > dataField="ContactName" />
> > <mx:DataGridColumn width="100" sortable="true" headerText="Company"
> > dataField="ContactCompanyName" />
> > <mx:DataGridColumn width="40" sortable="true"
> > sortCompareFunction="Sorts.compareNextCall" headerText="Next Call"
> > labelFunction="doNextCallLabel"/>
> > </mx:columns>
> > </mx:DataGrid>
> > 
> > Any help much appreciated,
> > Barry
> >
>


Reply via email to