| Package | feathers.controls |
| Class | public class DataGridColumn |
| Inheritance | DataGridColumn starling.events.EventDispatcher |
| Product Version : | Feathers 3.4.0 |
DataGrid component.
See also
| Property | Defined By | ||
|---|---|---|---|
| cellRendererFactory : Function
A function called that is expected to return a new cell renderer. | DataGridColumn | ||
| customCellRendererStyleName : String
A style name to add to all cell renderers in this column. | DataGridColumn | ||
| customHeaderRendererStyleName : String
A style name to add to all header renderers in this column. | DataGridColumn | ||
| dataField : String
The field in the item that contains the data to be displayed by
the cell renderers in this column. | DataGridColumn | ||
| headerRendererFactory : Function
A function called that is expected to return a new header renderer. | DataGridColumn | ||
| headerText : String
The text to display in the column's header. | DataGridColumn | ||
| minWidth : Number
The minimum width of the column, in pixels. | DataGridColumn | ||
| resizable : Boolean
Indicates if the column may be resized by dragging from its right edge. | DataGridColumn | ||
| sortCompareFunction : Function
A function to compare each item in the collection to determine the
order when sorted. | DataGridColumn | ||
| sortOrder : String
Indicates if the column may be sorted by triggering the
header renderer, and which direction it should be sorted
by default (ascending or descending). | DataGridColumn | ||
| width : Number
The width of the column, in pixels. | DataGridColumn | ||
| Method | Defined By | ||
|---|---|---|---|
DataGridColumn(dataField:String = null, headerText:String = null)
Constructor. | DataGridColumn | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when a property of the column changes. | DataGridColumn | |||
| cellRendererFactory | property |
cellRendererFactory:FunctionA function called that is expected to return a new cell renderer.
The function is expected to have the following signature:
function():IDataGridCellRenderer
The following example provides a factory for the cell renderer:
column.cellRendererFactory = function():IDataGridCellRenderer
{
var cellRenderer:CustomCellRendererClass = new CustomCellRendererClass();
cellRenderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );
return cellRenderer;
}; The default value is null.
public function get cellRendererFactory():Function public function set cellRendererFactory(value:Function):voidSee also
| customCellRendererStyleName | property |
customCellRendererStyleName:StringA style name to add to all cell renderers in this column. Typically used by a theme to provide different skins to different columns.
The following example sets the cell renderer style name:
column.customCellRendererStyleName = "my-custom-cell-renderer";
In your theme, you can target this sub-component name to provide different skins than the default style:
getStyleProviderForClass( DefaultDataGridCellRenderer ).setFunctionForStyleName( "my-custom-cell-renderer", setCustomCellRendererStyles );
The default value is null.
public function get customCellRendererStyleName():String public function set customCellRendererStyleName(value:String):voidSee also
| customHeaderRendererStyleName | property |
customHeaderRendererStyleName:StringA style name to add to all header renderers in this column. Typically used by a theme to provide different skins to different columns.
The following example sets the header renderer name:
column.customHeaderRendererStyleName = "my-custom-header-renderer";
In your theme, you can target this sub-component name to provide different skins than the default style:
getStyleProviderForClass( DefaultDataGridHeaderRenderer ).setFunctionForStyleName( "my-custom-header-renderer", setCustomHeaderRendererStyles );
The default value is null.
public function get customHeaderRendererStyleName():String public function set customHeaderRendererStyleName(value:String):voidSee also
| dataField | property |
dataField:String
The field in the item that contains the data to be displayed by
the cell renderers in this column. If the item does not have this
field, then the renderer may default to calling toString()
on the item.
In the following example, the data field is customized:
column.dataField = "name";
The default value is null.
public function get dataField():String public function set dataField(value:String):void| headerRendererFactory | property |
headerRendererFactory:FunctionA function called that is expected to return a new header renderer.
The function is expected to have the following signature:
function():IDataGridHeaderRenderer
The following example provides a factory for the header renderer:
column.headerRendererFactory = function():IDataGridHeaderRenderer
{
var headerRenderer:CustomHeaderRendererClass = new CustomHeaderRendererClass();
headerRenderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );
return headerRenderer;
}; The default value is null.
public function get headerRendererFactory():Function public function set headerRendererFactory(value:Function):voidSee also
| headerText | property |
headerText:StringThe text to display in the column's header.
In the following example, the header text is customized:
column.headerText = "Customer Name";
The default value is null.
public function get headerText():String public function set headerText(value:String):void| minWidth | property |
minWidth:NumberThe minimum width of the column, in pixels.
The following example sets the column minimum width:
column.minWidth = 200;
The default value is 10.
public function get minWidth():Number public function set minWidth(value:Number):void| resizable | property |
resizable:BooleanIndicates if the column may be resized by dragging from its right edge.
If the resizableColumns property of the
DataGrid is false, it takes precendence
over this property, and the column will not be resizable.
The following example disables resizing:
column.resizable = false;
The default value is true.
public function get resizable():Boolean public function set resizable(value:Boolean):voidSee also
| sortCompareFunction | property |
sortCompareFunction:FunctionA function to compare each item in the collection to determine the order when sorted.
The function is expected to have the following signature:
function( a:Object, b:Object ):int
The return value should be -1 if the first item
should appear before the second item when the collection is sorted.
The return value should be 1 if the first item should
appear after the second item when the collection in sorted. Finally,
the return value should be 0 if both items have the
same sort order.
The default value is null.
public function get sortCompareFunction():Function public function set sortCompareFunction(value:Function):voidSee also
| sortOrder | property |
sortOrder:StringIndicates if the column may be sorted by triggering the header renderer, and which direction it should be sorted by default (ascending or descending).
Setting this property will not start a sort. It only provides the initial order of the sort when triggered by the user.
If the sortableColumns property of the
DataGrid is false, it takes precendence
over this property, and the column will not be sortable.
The following example disables sorting:
column.sortOrder = SortOrder.NONE;
The default value is feathers.data.SortOrder.ASCENDING.
public function get sortOrder():String public function set sortOrder(value:String):voidSee also
| width | property |
width:Number
The width of the column, in pixels. If the width is set to
NaN, the column will be sized automatically by the
data grid's layout.
The following example sets the column width:
column.width = 200;
The default value is NaN.
public function get width():Number public function set width(value:Number):void| DataGridColumn | () | Constructor |
public function DataGridColumn(dataField:String = null, headerText:String = null)Constructor.
ParametersdataField:String (default = null) | |
headerText:String (default = null) |
| change | Event |
starling.events.Eventstarling.events.Event.CHANGEDispatched when a property of the column changes.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
data | null |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |