User Guide
128 CellRenderer API
The following example is from a radio button renderer. If the item parameter is undefined,
then the cell may be scrolled out of the display area and should be visibly empty. An
if
statement is used to determine if the
item parameter is undefined. If the item parameter is
undefined, the radio button is hidden by setting its
_visible property to false; otherwise,
the radio button is updated with the new data and appears.
function setValue(str:String, item:Object, sel:String) : Void {
/* Hide anything normally rendered in the cell if item is undefined.
Otherwise update the cell contents with the new data.
*/
if (item == undefined) {
radio._visible = false; }
else {
trace(item.data + " " + item.label + " " + item.state + " " + sel);
radio.label = item.label;
radio.data = item.data;
radio.selected = item.state;
radio._visible = true;
}
}