Parameters
A value to be used for the cell renderer's text, if any is needed.
suggested
An object that is the entire item to be rendered. The cell renderer can use properties of
item
this object for rendering.
A string with the following possible values:
,
, and
selected
"normal"
"highlighted"
.
"selected"
Returns
Nothing.
Description
Method; takes the values given and creates a representation of them in the cell. This resolves
any difference between what was displayed in the cell and what needs to be displayed in the
cell for the new item. (Remember that any cell could display many values during its time in
the list.) This is the most important CellRenderer method, and you must implement it in
every cell renderer.
The
method is called frequently (for example, when a rollover, a selection,
setValue()
column resizing, or scrolling occurs). It is important to remember that a cell might not exist
on the Stage and should not always be updated with data when
is called. For
setValue()
example, at any moment, a particular cell may be scrolled out of the display area or it might
be reused to render another value. For this reason, you cannot directly reference a specific cell
renderer instance in the grid, and you should write
statements in the body of
if
setValue()
that allow code to run only if the
parameter is defined and a change has occurred. An
item
undefined item parameter indicates that the cell should be visibly empty and any items in the
cell should be assigned a
property of
. Cells can be required to be visibly
_visible
false
empty temporarily, such as when scrolling occurs in a DataGrid.
If a row is selected and the pointer is over it, the value of the selected parameter is
, not
. This can cause problems if you're trying to make the cell
"highlighted"
"selected"
renderer behave differently according to whether the row is in a selected state. To test whether
the current row is in a selected state, use the following code:
var reallySelected:Boolean = selected != "normal" && listOwner.selectedNode
== item;
Example
The following example shows how to use
and
to reference a cell
setValue()
editField()
renderer instance in a grid.
CellRenderer.setValue()
125
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers