Similar to the above example, it is possible for
Flexicious Ultimate to display hierarchical data fed via an XMLListCollection.
In this example, we have a grid with 3 levels. Since we’re just using one set
of columns, we set reusePreviousLevelColumns to true on each of the
levels.
For the most part, Flexicious Ultimate is able to
display the data as is, but when we are looking at the Actual/Estimate columns,
since these properties only exist at the inner most levels, we need to do some
math to show the corresponding rollups at the upper levels. For this, we use
the labelFunction2 and footerLabelFunction2 functions.
labelFunction2: A specialized function that determines the text to display in this column, and takes the actual cell being evaluated as a parameter. As opposed to the regular label function, this actually takes a FlexDataGridCell object as a parameter, which contains the level information if you need to perform additional logic. Please note, the cell parameter will be null in certain cases, like from the quickFind() method, where the cell is not currently drawn. Example: labelFunction2="myLabelFunc"
private function
myLabelFunc(item:Object,col:FlexDataGridColumn,
cell:FlexDataGridCell=null):String{ }
footerLabelFunction2: A specialized function that determines the text to display
in this footer cell, and takes the actual cell being evaluated as a parameter.
As opposed to the regular footer label function, this actually takes a
FlexDataGridFooterCell object as a parameter, which contains the level
information if you need to perform additional logic. Example:
footerLabelFunction2=”myFooterLabelFunc”
private function myFooterLabelFunc
(cell:FlexDataGridFooterCell):String{}