This
example demonstrates a few features that we added to Flexicious Ultimate to
facilitate quick implementation of some of the most common UI requirements from
DataGrids in LOB applications.
These are:
This is accomplished
using the following functions:
The rowBackgroundColorFunction:
A function that can be used to control the background color of each cell in
this level. If this function is null or returns null, the cell background will use
the alternatingItemColors style property. This
function should take a IFlexDataGridDataCell
object, which has a pointer to the row data (data) as well as other related
information found in the documentation of the FlexDataGridDataCell
class. This function should return an array of colors for a gradient fill, or a
single color hex code (uint) for a single color fill.
The rowDisabledFunction : A function that can be used to control the enabled flag
of each cell in this level. If this function is null or returns null, the cell
will be enabled, selectable, and rollovers will work. If this function returns
false, the cell will not be selectable, the item renderers
will be disabled and it will have no rollovers.
This
function has two parameters:
1) IFlexDataGridDataCell : Cell object which has a pointer to the row data (data) as
well as other related information found in the documentation of the FlexDataGridDataCell class. This parameter can be null,
when the function is called as a response to a higher level checkbox select.
For example, when the user hits select all. In this case, we do not always have
a cell, and it will be passed in as null
2) The
actual data object bound to the row.
This
function should true or false.
For
example:
private
function rowDisabledFunction(cell:TreeDataGridCell,data:Object):Boolean{
return
data.enabled;
}
The rowTextColorFunction: A function that can be used to
control the text color of each cell in this level. If this function is null or
returns null, the cell text will use the alternatingTextColors
style property. This function should take a IFlexDataGridDataCell object, which has a pointer to the
row data (data) as well as other related information found in the documentation
of the FlexDataGridDataCell. This function should
return a single color hex code (uint).
The cellBackgroundFunction: A function that can be used to
control the background color of each cell in this column. If this function is
null or returns null, the cell will use the alternatingItemColors
style property. This function should take a IFlexDataGridDataCell, which has a pointer to the row data
(data) as well as other related information found in the documentation of the FlexDataGridDataCell class. This function should return an
array of colors for a gradient fill, or a single color hex code (uint) for a single color fill.
The cellTextColorFunction:
A function that can be used to control the Text color of each cell in
this column. If
this function is null or returns null, the cell Text will use the alternatingTextColors style property. This function should
take a IFlexDataGridDataCell
object, which has a pointer to the row data (data) as well as other related
information found in the documentation of the FlexDataGridDataCell
class. This function should return a single color hex code (uint).
The rendererInitialized
event: Dispatched when the renderer is initialized.
Please
note, any changes you made to the renderer stay in
place when the renderer is recycled. So if you make any changes, please ensure
that the changes are rolled back in the event handler first. For example, if
you set the text to bold if a condition is met, then you should first set it to
normal, check for the condition, and then set it to bold. This will ensure that
if the renderer was previously used to display something that match the
condition, and the current item does not, then we do not display bold text.