com.triomotor.cells

StepperCell

extends: AbstractCell

This class implements the CellRender API and inherits from AbstractCell.
The purpose of this class is to be used in conjunction with the DataGridColumn to render the specific cells of the column in a custom manner
This Cell shows a NumericStepper that allows the user to change the value of a specific cell

Property Summary

private NumericStepperstepper
private Labellabel

Constructor Summary

StepperCell()

Method Summary

public setValue(suggesteditem:Object, status:String)
public setSize(width:Number, height:Number)
public change()
private onLoad()

Property Details

stepper

private stepper:NumericStepper

This NumericStepper component is inside the StepperCell. Its instance name is "stepper"

label

private label:Label

This Label component is inside the StepperCell. Its instance name is "Label"

Constructor Details

StepperCell

StepperCell()

Method Details

setValue

public setValue(suggested,
                item:Object,
                status:String):Void

Description: Sets the value of the cell and alternates between the label and the stepper depending on the row state.
Globals: uses listOwner, stepper, label
Calls: getCellIndex()
Is Called by: This function is called by the datagrid each time that the Datagrid changes ( renders or draws )

Parameters
suggested - the value of the specific cell to render
item (Object) - a row object (one item of the DataGrid.dataProvider)
status (String) - a string representing the state of the row
Returns
void

setSize

public setSize(width:Number,
               height:Number):Void

Description: Sets the height and width of the cell
Assumptions: label and stepper are already loaded
Globals: uses stepper, label
Calls: setSize() in stepper and label
Is Called by: This function is called by the datagrid internally

Parameters
width (Number) -
height (Number) -
Returns
void

change

public change():Void

Description: Calls DetailView (listOwner._parent) to updates the value of the cell in the datagrid dataprovider where this cell resides.
Globals: uses listOwner
Calls: getCellIndex()
Is Called by: the stepper when the user changes the cell's value

Returns
void

onLoad

private onLoad():Void

Description: Hides the label and the stepper and adds this instance of the StepperCell as a listener of the stepper "change" event
Globals: uses label and stepper properties
Calls: stepper.addEventListener() to register for the change event
Is Called by: This function is called automatically by the player when this object is completely loaded. This occurs when the datagrid attaches the cell

Returns
void