com.triomotor.cells

TrashCell

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 button that allows the user to delete the row.

Property Summary

private Labellabel
private MovieCliptrash

Constructor Summary

TrashCell()

Method Summary

public setValue(suggested:String, item:Object, status:String)
public setSize(width:Number, height:Number)
public click()
private overwriteRecordSet()
private onLoad()

Property Details

label

private label:Label

this Label component is inside the TrashCell. Its instance name is "label"

trash

private trash:MovieClip

this MovieClip is inside the TrashCell. Its instance name is "trash"

Constructor Details

TrashCell

TrashCell()

Method Details

setValue

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

Description: Sets the value of the cell and showing or hides the trash button depending on the row state.
Globals: uses listOwner, trash, label
Calls: getCellIndex()
Is Called by: This function is called by the datagrid each time that the Datagrid changes ( renders or draws )
Assumptions: PART_ID = 1 is always labor, we will not show trash button in the labor row.

Parameters
suggested (String) - the value of the specific cell to render
item (Object) - a row object (one item of the DataGrid.dataProvider)
Returns
Void

setSize

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

Description: It's in charge of setting the height and width of the cell
Assumptions: label is already loaded
Globals: uses label
Calls: setSize() in label
Is Called by: This function is called by the datagrid internally

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

click

public click():Void

Description: Deletes the whole row in the datagrid owner where this cell resides
Assumptions: listOwner has been instantiated
Globals: uses listOwner
Calls: getCellIndex()
Is Called by: the trash button when the user clicks the button

Returns
Void

overwriteRecordSet

private overwriteRecordSet():Void

Description: this function fixes the bug in the RecordSet class
Assumptions: the bug is not fixed yet
Globals: none
Calls: none
Is Called by: onLoad()

Returns
void

onLoad

private onLoad():Void

Description: Hides the trash view and adds an onRelease function to the trash that will call the method click on this class
Assumptions: trash has been instantiated on the stage
Globals: uses trash property
Calls: overwriteRecordSet()
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