Package | spark.components.gridClasses |
Interface | public interface IGridVisualElement |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 4.5 |
Runtime Versions: | Flash Player 10, AIR 2.0 |
This is an optional interface for all of the factory-generated
visual elements except itemRenderers: caretIndicator
,
hoverIndicator
, editorIndicator
,
selectionIndicator
, columnSeparator
,
rowSeparator
,
alternatingRowColorsBackground
(see DataGrid),
sortIndicator
(see GridColumnHeaderGroup). It's
typically used to configure generated visual elements with
DataGrid's style values. For example, to use the value of the
DataGrid's "symbolColor" style for the caret's fill color,
one would define the prepareGridVisualElement()
method like this:
public function prepareGridVisualElement(grid:Grid, rowIndex:int, columnIndex:int):void { caretStroke.color = grid.dataGrid.getStyle("caretColor"); }
The rowIndex
and columnIndex
parameters specify the
the cell the visual element will occupy. If columnIndex
= -1 then the visual element
occupies a Grid row. If rowIndex
= -1 then the visual element occupies
a Grid column.
There are many more examples like this in DataGridSkin.mxml. Note that custom DataGrid skin visual elements can choose not to implement this interface if the the added flexibility isn't needed.
Method | Defined By |
---|
Wed Nov 21 2018, 06:34 AM -08:00