Hi,
I am trying to style rows in an AdvancedDataGrid based on properties of
items in the ArrayCollection populating the datagrid. I am attempting to
use the styleFunction of the AdvancedDataGridColumn. This affects the color
of the text (correct), but not the background(not correct). Can anyone
explain why this might be? Even though I list backgroundColor:0xCCCCC, the
background color does not change.
Why?
protected function projectsStyle( data:Object, col:AdvancedDataGridColumn
):Object
{
if (data["isDeleted"] == '0')
{
return { color:0xFF0000, backgroundColor:0xCCCCC}; //weird
colors for demo
}else{
return {color:0x999999, backgroundColor:0xCCCCCC};
}
}
<mx:AdvancedDataGrid id="projects_dg"
dataProvider="{model.projectsModel.projectsAC}"
allowMultipleSelection="false" selectionMode="multipleRows"
change="onSelectProject(event)" styleName="sidebarNavigatorDetail"
headerStyleName="mainContentDetail" horizontalScrollPolicy="off"
showDataTips="true" width="100%" height="100%" >
<mx:columns>
<mx:AdvancedDataGridColumn backgroundColor="#cc0000"
styleFunction="projectsStyle" headerText="{projectHeader}"
dataField="title"/>
</mx:columns>
</mx:AdvancedDataGrid>
--
Johnny Waggener
Software Developer
Multicast Media
678-592-2650