Amy, thanks.  The only difference is that I'm assigning the iconFunction in AS 
like so:

adg.iconFunction = myFunction;
private function myFunction(item:Object):Class {
    trace("made it this far!");
}

I get nothing.  Let me look into it further.  Thanks for all your help.

Brandon



----- Original Message ----
From: Amy <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, July 22, 2008 10:51:25 PM
Subject: [flexcoders] Re: referencing embedded images inside 
AdvancedDataGridGroupItemRenderer


--- In [EMAIL PROTECTED] ups.com, Brandon Krakowsky <krakowskyb@ ...> 
wrote:
>
> Amy, I can't seem to get the iconFunction to work with the ADG.  As 
per the docs, "This property is ignored by data grid controls."
> 
> It compiles but it IS in fact ignored.  Do you use the 
groupIconFunction?

The iconFunction is not ignored by the _Advanced_ Data Grid.  I can 
tell you this, because I use it successfully in a project I just 
finished.

here's a snippet of my code

//show appropriate menu icon based on state ond
//nature of item
private function menuIcon(item: Object):Class{
if (item is TaskUID){
var taskItem:TaskUID = item as 
TaskUID;
switch (taskItem.isComplet e) {
case Task.NOT_STARTED:
return icnEmpty;
case Task.STARTED:
return icnStarted;
case Task.COMPLETE:
return icnComplete;
}
} else if (item is MenuContainer) {
var containerItem: MenuContainer = 
item as MenuContainer;
switch (containerItem. runMode) {
case 'Normal':
return icnNormal;
case 'Review':
return icnReview;
case 'Analysis':
return icnAnalysis;
}
}
return null;
}

The MXML looks like this:

<mx:AdvancedDataGri d id="menuADG" showHeaders= "false" width="100%"

itemRenderer= "com.magnoliamul timedia.views. ADGGroupItemRend ere
rPatch" 

groupItemRenderer= "com.magnoliamul timedia.views. ADGGroupItemRe
ndererPatch"
fontSize="14" rowCount="{_ menuRows} "
styleFunction= "styleMenuItems" 
iconFunction= "menuIcon"
verticalGridLines= "false" 
itemClick="onMenuIt emClick(event) "
defaultLeafIcon= "{null}" 
folderClosedIcon= "{null}" folderOpenIcon= "{null}" >
<mx:dataProvider>
<mx:HierarchicalDat a 
source="{_allTasks} " />
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGri dColumn 
dataField="desc" labelFunction= "menuADGItemLabe l" 

styleFunction= "styleMenuItems" width="400" />
<mx:AdvancedDataGri dColumn 
dataField="taskDate " >
<mx:formatter>

<mx:DateFormatter formatString= "EEE, MMMM D" />
</mx:formatter>
</mx:AdvancedDataGr idColumn>
</mx:columns>
</mx:AdvancedDataGr id>

    


      

Reply via email to