Packagetwaver.controls
Classpublic class Table
InheritanceTable Inheritance mx.controls.DataGrid

This table is one of TWaver Flex graphical components that works with DataBox to display data hierarchy for telecom network data. Table extends from Flex DataGrid and support more features like sorting, filter etc.

Here is an example of using Table:

	 var box:DataBox = new DataBox();
	 var table:Table = new Table(box);	
	 

Default MXML PropertydataProvider



Public Properties
 PropertyDefined By
  columns : Array
[override] [write-only]
Table
  compareFunction : Function
Comparator of this view to compare the data order of this view.
Table
  dataBox : DataBox
Get data box container from this view.
Table
  iterateMode : String
Get the data iterator mode.
Table
  makeVisibleOnSelected : Boolean
Get the value that whether data should be scrolled to visible when it is selected.
Table
  selectedIndices : Array
[override] [write-only]
Table
  selectedItem : Object
[override] [write-only]
Table
  selectionModel : SelectionModel
[read-only] Get the selection model of this view.
Table
  shareSelectionModel : Boolean
Whether share selection model container of this view with other views connecting to the same data box.
Table
  visibleFunction : Function
Get the visible filter function for this view.
Table
Public Methods
 MethodDefined By
  
Table(dataBox:DataBox = null)
Create a table component connecting to the specified data box.
Table
  
addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener into this view.
Table
  
addSelectionChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add data selection change listener into this view.
Table
  
callLater2(method:Function, args:Array = null):void
TWaver call later function.
Table
  
dispatchPropertyChangeEvent2(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch a property change event to all property change listeners.
Table
  
Get row index of this specified data.
Table
  
Get table row data of specified TWaver data with a TableData type.
Table
  
isVisible(data:IData):Boolean
Check whether the given data should be visible on this view.
Table
  
makeVisible(data:IData):void
Call this to make the table row of this specified data scroll-to-visible.
Table
  
Move all selected data to lower index.
Table
  
Move all selected data to bottom index.
Table
  
Move all selected data to top index.
Table
  
Move all selected data to upper index.
Table
  
removePropertyChangeListener(listener:Function):void
Remove specified property change listener from this view.
Table
  
Remove all selected data from view connected data box.
Table
  
removeSelectionChangeListener(listener:Function):void
Remove data selection change listener from this view.
Table
  
Select all visible data of this view.
Table
  
Update the table view by the sorting comparator and visible filter.
Table
Protected Methods
 MethodDefined By
  
[override]
Table
  
isComplexColumn(property:String):Boolean
[override]
Table
  
onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
Called on property change.
Table
  
Table
Property Detail
columnsproperty
columns:Array  [write-only] [override]


Implementation
    public function set columns(value:Array):void
compareFunctionproperty 
compareFunction:Function

Comparator of this view to compare the data order of this view.


Implementation
    public function get compareFunction():Function
    public function set compareFunction(value:Function):void
dataBoxproperty 
dataBox:DataBox

Get data box container from this view.


Implementation
    public function get dataBox():DataBox
    public function set dataBox(value:DataBox):void
iterateModeproperty 
iterateMode:String

Get the data iterator mode. Value can be:


Implementation
    public function get iterateMode():String
    public function set iterateMode(value:String):void
makeVisibleOnSelectedproperty 
makeVisibleOnSelected:Boolean

Get the value that whether data should be scrolled to visible when it is selected.


Implementation
    public function get makeVisibleOnSelected():Boolean
    public function set makeVisibleOnSelected(value:Boolean):void
selectedIndicesproperty 
selectedIndices:Array  [write-only] [override]


Implementation
    public function set selectedIndices(value:Array):void
selectedItemproperty 
selectedItem:Object  [write-only] [override]


Implementation
    public function set selectedItem(value:Object):void
selectionModelproperty 
selectionModel:SelectionModel  [read-only]

Get the selection model of this view.


Implementation
    public function get selectionModel():SelectionModel

See also

shareSelectionModelproperty 
shareSelectionModel:Boolean

Whether share selection model container of this view with other views connecting to the same data box. If share, then this view will not maintain an own selection model container, instead, using the data box's selection model. If not, then this view will maintain an own selection model container, then every view has own selection model even they connecting a same data box.


Implementation
    public function get shareSelectionModel():Boolean
    public function set shareSelectionModel(value:Boolean):void
visibleFunctionproperty 
visibleFunction:Function

Get the visible filter function for this view. This will used to determine whether a data should be visible on this view.


Implementation
    public function get visibleFunction():Function
    public function set visibleFunction(value:Function):void
Constructor Detail
Table()Constructor
public function Table(dataBox:DataBox = null)

Create a table component connecting to the specified data box.

Parameters
dataBox:DataBox (default = null) — the data box contains data of this table.
Method Detail
addPropertyChangeListener()method
public function addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Add a property change listener into this view. It will be notified when property changed.

Parameters

listener:Function — the listener to be installed.
 
priority:int (default = 0) — the listening priority
 
useWeakReference:Boolean (default = false) — whether use weak feference

addSelectionChangeListener()method 
public function addSelectionChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Add data selection change listener into this view. The listener will be notified when the selection of any data is changed.

Parameters

listener:Function — the listener to be added.
 
priority:int (default = 0) — the listening priority
 
useWeakReference:Boolean (default = false) — whether use weak reference

callLater2()method 
public function callLater2(method:Function, args:Array = null):void

TWaver call later function. Wait in queue and call the specified function later with specified arguments.

Parameters

method:Function — the method will be called later.
 
args:Array (default = null) — the arguments that will be used when method is called.

commitProperties()method 
override protected function commitProperties():void

dispatchPropertyChangeEvent2()method 
public function dispatchPropertyChangeEvent2(property:String, oldValue:Object, newValue:Object):Boolean

Dispatch a property change event to all property change listeners. The "2" in the end of this method name is to avoid override the default same method defined in Flex 3.

Parameters

property:String — the property name to be dispatched.
 
oldValue:Object — old value before the change
 
newValue:Object — new value after the change

Returns
Boolean — true if dispatched successfully, false otherwise.
getDataIndex()method 
public function getDataIndex(data:IData):int

Get row index of this specified data.

Parameters

data:IData — the data to be checked.

Returns
int — the row index of this data.
getTableData()method 
public function getTableData(data:IData):TableData

Get table row data of specified TWaver data with a TableData type.

Parameters

data:IData — the TWaver IData need to get.

Returns
TableData — the table row data with a TableData type.

See also

isComplexColumn()method 
override protected function isComplexColumn(property:String):Boolean

Parameters

property:String

Returns
Boolean
isVisible()method 
public function isVisible(data:IData):Boolean

Check whether the given data should be visible on this view.

Parameters

data:IData — the data to be checked.

Returns
Boolean — true if specified data is visible, false otherwise.
makeVisible()method 
public function makeVisible(data:IData):void

Call this to make the table row of this specified data scroll-to-visible.

Parameters

data:IData — the data to be scrolled to visible.

moveSelectionDown()method 
public function moveSelectionDown():void

Move all selected data to lower index.

moveSelectionToBottom()method 
public function moveSelectionToBottom():void

Move all selected data to bottom index.

moveSelectionToTop()method 
public function moveSelectionToTop():void

Move all selected data to top index.

moveSelectionUp()method 
public function moveSelectionUp():void

Move all selected data to upper index.

onPropertyChanged()method 
protected function onPropertyChanged(property:String, oldValue:Object, newValue:Object):void

Called on property change.

Parameters

property:String — the property name which is changed.
 
oldValue:Object — old value before change
 
newValue:Object — new value after change.

onSelectionChanged()method 
protected function onSelectionChanged(e:SelectionChangeEvent):void

Parameters

e:SelectionChangeEvent

removePropertyChangeListener()method 
public function removePropertyChangeListener(listener:Function):void

Remove specified property change listener from this view.

Parameters

listener:Function — the listener to be removed.

removeSelection()method 
public function removeSelection():ICollection

Remove all selected data from view connected data box.

Returns
ICollection — the all removed data as a collection.
removeSelectionChangeListener()method 
public function removeSelectionChangeListener(listener:Function):void

Remove data selection change listener from this view.

Parameters

listener:Function — the selection change listener to be removed.

selectAll()method 
public function selectAll():ICollection

Select all visible data of this view.

Returns
ICollection — a collection contains all selected data.
updateCompareAndVisibility()method 
public function updateCompareAndVisibility():void

Update the table view by the sorting comparator and visible filter.