[intro]     [up]

Class Column


Represents a table column.

Example
//Assume the table is a valid instance
var table;

//Add a column
var col = table.addColumn(new Column("Sex", JST_TYPE_STRING));
col.possibleValues = new Map([new Pair("m", "Male"), new Pair("f", "Female")]);


Constructor Arguments
Name Type Default Description
header String An empty String The header property
type enum JST_TYPE_STRING The type property
width String Not specified The width property
align String JST_ALIGN_LEFT The align property. Any String may be used, but there are some constants named JST_ALIGN_* to help
valign String JST_VALIGN_MIDDLE The valign property. Any String may be used, but there are some constants named JST_VALIGN_* to help
possibleValues Map null The possibleValues property

Properties
Basic properties
index Column's index on the table
table The column table reference
Appearance properties
align The align property
cellTextClass If indicated, this class will be used for this column's cell text
cellTextStyle If indicated, this style definition will be used for this column's cell text
cropRepeated If set to true, don't display repeated values on contiguous rows
evenRowCellWithFunctionClass If indicated, this class will be used for even row cells with functions
header The header property
headerTextClass If indicated, this class will be used for this column's header text
headerTextStyle If indicated, this style definition will be used for this column's header text
highlightedEvenRowCellWithFunctionClass If indicated, this class will be used for highlighted even row cells with functions
highlightedOddRowCellWithFunctionClass If indicated, this class will be used for highlighted odd row cells with functions
oddRowCellWithFunctionClass If indicated, this class will be used for odd row cells with functions
valign The valign property
visible A flag indicating if the column is visible
width The width property
Behaviour and data entry properties
allowEmptyValue A flag indicating if the column, when being edited, allows empty values
editControl An EditControl instance, the column editor
editable A flag indicating if the column can be edited
encodingParser A parser instance for data encoding
parser A parser instance for data editing
possibleValues The possibleValues property
sortable A flag indicating if the column can be sorted
type The type property
Callback function properties
cellFunction A function name to be called when the user clicks on the cell text
getMaskFunction A function reference to be called to retrieve the mask for the edit control
validateFunction A function reference to be called after data entry, to validate the input

Methods
Parser obtention methods
getEncodingParser Returns the column encoding parser
getParser Returns the column edit parser



Properties
Basic properties
Basic column properties
index
Column's index on the table. Should never be changed
table
The column table reference. Should never be changed


Appearance properties
properties that defines the column appearance
align
The align property. Any String may be used, but there are some constants named JST_ALIGN_* to help
cellTextClass
If indicated, this class will be used for this column's cell text
cellTextStyle
If indicated, this style definition will be used for this column's cell text
cropRepeated
If set to true, don't display repeated values on contiguous rows
evenRowCellWithFunctionClass
If indicated, this class will be used for even row cells with functions
header
The header property
headerTextClass
If indicated, this class will be used for this column's header text
headerTextStyle
If indicated, this style definition will be used for this column's header text
highlightedEvenRowCellWithFunctionClass
If indicated, this class will be used for highlighted even row cells with functions
highlightedOddRowCellWithFunctionClass
If indicated, this class will be used for highlighted odd row cells with functions
oddRowCellWithFunctionClass
If indicated, this class will be used for odd row cells with functions
valign
The valign property. Any String may be used, but there are some constants named JST_VALIGN_* to help
visible
A flag indicating if the column is visible
width
The width property


Behaviour and data entry properties
properties that defines the column behaviour
allowEmptyValue
A flag indicating if the column, when being edited, allows empty values. If an empty value is typed, the validateFunction callback, if defined, is not invoked
editControl
An EditControl instance, the column editor
editable
A flag indicating if the column can be edited
encodingParser
A parser instance for data encoding
parser
A parser instance for data editing
possibleValues
The possibleValues property
sortable
A flag indicating if the column can be sorted
type
The type property


Callback function properties
Reference to functions or function names to be called on some particular events
cellFunction
A function name to be called when the user clicks on the cell text. The rowId, columnIndex and table references are passed as arguments
getMaskFunction
A function reference to be called to retrieve the mask for the edit control. The parameters are: The control reference, the column reference and the row reference
validateFunction
A function reference to be called after data entry, to validate the input. The parameters are the parsedValue, the column instance and the row instance





Methods
Parser obtention methods
Methods used to return the column parsers
 
getEncodingParser
Returns the column encoding parser. If no specific parser is used, return the table default encoding parser for the column data type
 
getParser
Returns the column edit parser. If no specific parser is used, return the table default parser for the column data type