BiGridColumn

This class is used to describe columns for BiGrid and BiTree.

This class extends BiObject and therefore all methods and fields available for BiObject are also available for BiGridColumn .

Constructor

new BiGridColumn ( [ sName ] )

Parameters

NameTypeOptionalDefaultDescripton
sNameStringcheckedUntitledThis is used for the text to to show on the header cell for the column

Properties

NameTypegetsetDescripton
alignStringcheckedcheckedThe alignment of the content inside the column.
columnIndexNumbercheckedThe index of the column in the grid columns collection. This is not necessarily the same as the display order.
gridBiAbstractGridcheckedThe grid that the column is used in.
headerBiGridHeadercheckedThis is the header representing the column in the grid.
iconColumnNumbercheckedcheckedWhether the current column is the icon column in the grid.
indentColumnNumbercheckedcheckedWhether the current column is the indent column in the grid. This is ignored when using the columns for a non tree.
nameStringcheckedcheckedThe name of the column. This is the same as the text shown on the header.
orderIndexNumbercheckedThe index of the column as it is currently being displayed. This means that the left most column has an order index of 0. This is not necessarily the same as the columnIndex when the columns have been reordered.
sortFunctionFunctioncheckedThis returns the function used to compare two grid rows. This means that this should return a function that takes two arguments and returns a number (just like the normal comparison function used when sorting arrays in JavaScript).
sortTypeStringcheckedcheckedThe type of the data in the column. This is used to decide how to sort the data in the column. Built in support for the following types:

string
caseInsensitiveString
number
date - Uses the native JS Date type

To get better control over the sorting create a subclass that overrides the sortFunction getter.
treeBiAbstractGridcheckedThe grid that the column is used in. (Same as grid.)
widthNumbercheckedcheckedThe width of the column.
visibleBooleancheckedcheckedWhether the column is visible or not.

Methods

None.

Events

None.

Static Methods

NameDescription
caseInsensitiveStringCompareA function taking two strings and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero). This comparison is case insensitive.
dateCompareA function taking two Date objects and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).
lessThanCompareA function taking two objects and uses the built in less than operator to compare them and returns a number (less than zero if first is smaller, zero if equal and otherwise larger than zero).
numberCompareA function taking two number arguments and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).
stringCompareA function taking two strings and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Static Fields

None.

Remarks

None.

Static Method Details

caseInsensitiveStringCompare

A function taking two strings and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero). This comparison is case insensitive.

Syntax

BiGridColumn . caseInsensitiveStringCompare ( s1,s2 )

Parameters

NameTypeOptionalDefaultDescripton
s1StringThe first string
s2StringThe second string

Return Type

Boolean

dateCompare

A function taking two Date objects and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Syntax

BiGridColumn . dateCompare ( d1,d2 )

Parameters

NameTypeOptionalDefaultDescripton
d1DateThe first date
d2DateThe second date

Return Type

Boolean

lessThanCompare

A function taking two objects and uses the built in less than operator to compare them and returns a number (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Syntax

BiGridColumn . lessThanCompare ( v1,v2 )

Parameters

NameTypeOptionalDefaultDescripton
v1ObjectThe first value
v2ObjectThe second value

Return Type

Boolean

numberCompare

A function taking two number arguments and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Syntax

BiGridColumn . numberCompare ( n1,n2 )

Parameters

NameTypeOptionalDefaultDescripton
n1NumberThe first number
n2NumberThe second number

Return Type

Boolean

stringCompare

A function taking two strings and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Syntax

BiGridColumn . stringCompare ( s1,s2 )

Parameters

NameTypeOptionalDefaultDescripton
s1StringThe first string
s2StringThe second string

Return Type

Boolean