class GridViewColumn
package feathers.controls
extends EventDispatcher
implements IGridViewColumn
Constructor
new(?headerText:String, ?itemToText:Dynamic ‑> String, ?width:Float)
Creates a new GridViewColumn
object with the given arguments.
1.0.0
.Variables
cellRendererRecycler:AbstractDisplayObjectRecycler<Dynamic, GridViewCellState, DisplayObject> = null
Manages cell renderers used by this grid view column.
In the following example, the column uses a custom cell renderer class:
column.cellRendererRecycler = DisplayObjectRecycler.withClass(CustomCellRenderer);
1.0.0
.See also:
defaultSortOrder:SortOrder = ASCENDING
Indicates 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 GridView
is false
, it takes
precendence over this property, and the column will not be sortable by
the user under any circumstances.
The following example disables sorting of a column:
column.defaultSortOrder = SortOrder.NONE;
1.0.0
.See also:
headerText:String
The text to display in the column's header.
In the following example, the column's header text is customized.
column.headerText = "Name";
1.0.0
.minWidth:Float = 0.0
The minimum width of the column, measured in pixels.
If the width
is specified explicitly, then the minWidth
will be
ignored.
In the following example, the column's minimum width is customized.
column.minWidth = 120.0;
1.0.0
.width:Null<Float> = null
The width of the column, measured in pixels.
In the following example, the column's width is customized.
column.width = 120.0;
1.0.0
.sortCompareFunction:(Dynamic, Dynamic) ‑> Int = null
A function to compare each item in the collection to determine the order when sorted.
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.
1.0.0
.See also:
Methods
dynamicitemToText(data:Dynamic):String
Converts an item to text to display within a grid view cell. By default,
the toString()
method is called to convert an item to text. This
method may be replaced to provide custom text.
For example, consider the following item:
{ text: "Example Item" }
If the grid view cell should display the text "Example Item", a custom
implementation of itemToText()
might look like this:
column.itemToText = (item:Dynamic) -> {
return item.text;
};
1.0.0
.