Packageorg.ghostfish.components
Classpublic class AutoSortDataGrid
InheritanceAutoSortDataGrid Inheritance mx.controls.DataGrid

Small extension to the DataGrid class that allows the datagrid to start up in a sorted state.

Default MXML PropertydataProvider



Public Properties
 PropertyDefined By
  dataProvider : Object
[override] [write-only] If a sort column has been specified via the sortColumn field, an appropriate sort object is applied to the dataProvider and the latter's refresh() method is called.
AutoSortDataGrid
  sortColumn : DataGridColumn
[write-only] Defines the column within the table to use as the initial sort column.
AutoSortDataGrid
  sortDescending : Boolean
[write-only] Defines whether the initially sorted column should sort in a descending fashion or not.
AutoSortDataGrid
Protected Methods
 MethodDefined By
  
[override] If the data is provided via MXML, the dataProvider is specified before the sortColumn etc properties.
AutoSortDataGrid
Property Detail
dataProviderproperty
dataProvider:Object  [write-only] [override]

If a sort column has been specified via the sortColumn field, an appropriate sort object is applied to the dataProvider and the latter's refresh() method is called. The data grid is then allowed to do its normal thing.

If no sort column has been specified, this method behaves just like the parent version.


Implementation
    public function set dataProvider(value:Object):void
sortColumnproperty 
sortColumn:DataGridColumn  [write-only]

Defines the column within the table to use as the initial sort column.


Implementation
    public function set sortColumn(value:DataGridColumn):void
sortDescendingproperty 
sortDescending:Boolean  [write-only]

Defines whether the initially sorted column should sort in a descending fashion or not. Defaults to false.


Implementation
    public function set sortDescending(value:Boolean):void
Method Detail
commitProperties()method
override protected function commitProperties():void

If the data is provided via MXML, the dataProvider is specified before the sortColumn etc properties. The latter are applied via the commitProperties method. So we override that here and, if a sort column and the dataProvider are specified after the commit, we apply the sort here.