I'm displaying lists of events, and need to provide a total of certain
values contained in each event. The display also contains controls to
filter what events are shown and the totals need to honor these filters.
I have the following code that works in initial display, but does not
update when filters are applied. How does one dynamically bind to a
"function" instead of a discrete value?
protected function staffDayTotal(day:Object):int
{
var staffTot:int = 0;
for (var i:int = 0; i < day.drawsQry.length; i++)
{
if (parentApplication.filterDraws(day.drawsQry[i]))
staffTot = staffTot + day.drawsQry[i].R_MDL_STFCNT;
}
return staffTot;
}
...
<mx:Label paddingLeft="0" paddingRight="0"
text="{staffDayTotal(totalCells.currentItem)}"
width="20%" minWidth="0" minHeight="0"
toolTip="Daily Total: Staff Count"/>