Package | twaver.controls |
Class | public class Table |
Inheritance | Table ![]() |
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
Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
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 | ||
getDataIndex(data:IData):int
Get row index of this specified data. | Table | ||
Get table row data of specified TWaver data with a TableData type. | Table | ||
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 | ||
moveSelectionDown():void
Move all selected data to lower index. | Table | ||
moveSelectionToBottom():void
Move all selected data to bottom index. | Table | ||
moveSelectionToTop():void
Move all selected data to top index. | Table | ||
moveSelectionUp():void
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 | ||
updateCompareAndVisibility():void
Update the table view by the sorting comparator and
visible filter. | Table |
Method | Defined By | ||
---|---|---|---|
commitProperties():void [override]
| Table | ||
isComplexColumn(property:String):Boolean [override]
| Table | ||
onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
Called on property change. | Table | ||
Table |
columns | property |
columns:Array
[write-only] [override]
public function set columns(value:Array):void
compareFunction | property |
compareFunction:Function
Comparator of this view to compare the data order of this view.
public function get compareFunction():Function
public function set compareFunction(value:Function):void
dataBox | property |
dataBox:DataBox
Get data box container from this view.
public function get dataBox():DataBox
public function set dataBox(value:DataBox):void
iterateMode | property |
iterateMode:String
Get the data iterator mode. Value can be:
public function get iterateMode():String
public function set iterateMode(value:String):void
makeVisibleOnSelected | property |
makeVisibleOnSelected:Boolean
Get the value that whether data should be scrolled to visible when it is selected.
public function get makeVisibleOnSelected():Boolean
public function set makeVisibleOnSelected(value:Boolean):void
selectedIndices | property |
selectedIndices:Array
[write-only] [override]
public function set selectedIndices(value:Array):void
selectedItem | property |
selectedItem:Object
[write-only] [override]
public function set selectedItem(value:Object):void
selectionModel | property |
selectionModel:SelectionModel
[read-only] Get the selection model of this view.
public function get selectionModel():SelectionModel
See also
shareSelectionModel | property |
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.
public function get shareSelectionModel():Boolean
public function set shareSelectionModel(value:Boolean):void
visibleFunction | property |
visibleFunction:Function
Get the visible filter function for this view. This will used to determine whether a data should be visible on this view.
public function get visibleFunction():Function
public function set visibleFunction(value:Function):void
Table | () | Constructor |
public function Table(dataBox:DataBox = null)
Create a table component connecting to the specified data box.
ParametersdataBox:DataBox (default = null ) — the data box contains data of this table.
|
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
|
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.
|
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.
|
TableData — the table row data with a TableData type.
|
See also
isComplexColumn | () | method |
override protected function isComplexColumn(property:String):Boolean
Parameters
property:String |
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.
|
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.
ReturnsICollection — 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.
ReturnsICollection — a collection contains all selected data.
|
updateCompareAndVisibility | () | method |
public function updateCompareAndVisibility():void
Update the table view by the sorting comparator and visible filter.