Class
caplin.grid

GridColumn

A GridColumn represents a column within the grid, and allows the width of the column, and any sort order or display filters to be accessed and/or modified.

Constructor Summary

Attributes Name and Description
caplin.grid.GridColumn(caplin.grid.GridColumnModel oColumnModel, Map mProperties, Array pFilters)

Constructs a caplin.grid.GridColumn instance — end-users will never need to do this themselves since grids are fully constructed based on their XML definition files by the caplin.grid.GridComponentFactory class.

Field Summary

Attributes Name and Description
<static> caplin.grid.GridColumn.SORT_ASC

The constant definition used when invoking #setSortOrder and requesting an ascending sort.

<static> caplin.grid.GridColumn.SORT_DESC

The constant definition used when invoking #setSortOrder and requesting a descending sort.

<static> caplin.grid.GridColumn.SORT_NONE

The constant definition used when invoking #setSortOrder and requesting no sort at all.

Method Summary

Attributes Name and Description
void addFilter(int nFilterType, String sFilterValue)

Add a filter to this column that will limit the available rows within the grid.

void clearFilters()

Removes all the filters that this column is currently using to filter values with.

caplin.element.Renderer createElementRenderer()

Returns a new instance of the caplin.element.Renderer this column uses to perform cell rendering.

caplin.element.Renderer createHeaderElementRenderer(Array pFieldNames)

Returns a new instance of the caplin.element.Renderer this column uses to perform header rendering.

void getCellRendererType()

Returns the Cell Renderer Type for this column.

String getClassNames()

Returns the css class names that this column will use to display itself.

int getColumnIndex()

Returns the index of the column within the column model, or null if the column is not currently an active column within the model.

caplin.grid.GridColumnModel getColumnModel()

Returns the underlying grid column model that this column is a member of.

Array getFieldNames()

Returns the field names that are required by this column.

Array getFilters()

Returns all the filters that this column is currently using to perform row filtering with.

String getFriendlyName()

Returns the friendly name that this column will use to display itself.

String getIdentityName()

Return the name that uniquely identifies this column, as defined with the XML configuration for this grid.

void getPrimaryFieldName()

Returns the name of the primary field being displayed by this column.

String getPrimaryFieldType()

Returns the type of the primary field being displayed by this column.

int getSortOrder()

Returns the sort order that is currently set on this column.

Variant getValue(String sFieldName)

Returns the value associated with the supplied field name.

int getWidth()

Returns the width that this column has been set to.

void getWidthBeforeLatestColumnWidth()

If the columns width changes this will return the value before the latest change.

boolean isClear()

Determines whether a column is static or not.

boolean isFixed()

Determines whether a column is fixed or not.

boolean isMandatory()

Determines whether a column is optional or not.

boolean isResizable()

Determines whether a column is resizable or not.

boolean isSortable()

Return the boolean flag indicating whether or not this column can be sorted on as defined within the XML configuration for this grid column.

void setSortOrder(int nSortOrder)

Sets the sort order that this column should use for sorting.

void setValue(String sFieldName, Variant vFieldValue)

Sets the value of the specified field.

void setWidth(int nWidth)

Sets the width of this column.

Constructor Detail

caplin.grid.GridColumn(caplin.grid.GridColumnModel oColumnModel, Map mProperties, Array pFilters)

Constructs a caplin.grid.GridColumn instance — end-users will never need to do this themselves since grids are fully constructed based on their XML definition files by the caplin.grid.GridComponentFactory class.

Parameters
caplin.grid.GridColumnModel oColumnModel The column model that this column is a member of.
Map mProperties A map of all the properties extracted from the XML configuration.
Array pFilters The list of caplin.grid.GridColumnFilter instances that will be applied to the column.
Throws
caplin.core.Error
If the specified width is not a number, or the properties are invalid.

Field Detail

<static> int caplin.grid.GridColumn.SORT_ASC

The constant definition used when invoking #setSortOrder and requesting an ascending sort.

<static> int caplin.grid.GridColumn.SORT_DESC

The constant definition used when invoking #setSortOrder and requesting a descending sort.

<static> int caplin.grid.GridColumn.SORT_NONE

The constant definition used when invoking #setSortOrder and requesting no sort at all.

Method Detail

void addFilter(int nFilterType, String sFilterValue)

Add a filter to this column that will limit the available rows within the grid.

The available filter types that can be added to this column are caplin.grid.GridColumnFilter.LESS_THAN, caplin.grid.GridColumnFilter.GREATER_THAN, caplin.grid.GridColumnFilter.EXACT_MATCH, caplin.grid.GridColumnFilter.PARTIAL_MATCH, caplin.grid.GridColumnFilter.WILDCARD, caplin.grid.GridColumnFilter.WILDCARD_CASE_SENSITIVE, caplin.grid.GridColumnFilter.REGULAR_EXPRESSION and caplin.grid.GridColumnFilter.REGULAR_EXPRESSION_CASE_INSENSITIVE.

Parameters
int nFilterType The type of filter to apply to this column.
String sFilterValue The value that will be used to filter this column with.
See
#clearFilters
#getFilters

void clearFilters()

Removes all the filters that this column is currently using to filter values with.

See
#addFilter
#getFilters

caplin.element.Renderer createElementRenderer()

Returns a new instance of the caplin.element.Renderer this column uses to perform cell rendering.

caplin.element.Renderer createHeaderElementRenderer(Array pFieldNames)

Returns a new instance of the caplin.element.Renderer this column uses to perform header rendering.

Parameters
Array pFieldNames The field names to pass to the renderer.

void getCellRendererType()

Returns the Cell Renderer Type for this column.

Returns
Object

String getClassNames()

Returns the css class names that this column will use to display itself.

int getColumnIndex()

Returns the index of the column within the column model, or null if the column is not currently an active column within the model.

caplin.grid.GridColumnModel getColumnModel()

Returns the underlying grid column model that this column is a member of.

Array getFieldNames()

Returns the field names that are required by this column.

Returns
An array of field names as strings.

Array getFilters()

Returns all the filters that this column is currently using to perform row filtering with.

Returns
An array of caplin.grid.GridColumnFilter objects.
See
#addFilter
#clearFilters

String getFriendlyName()

Returns the friendly name that this column will use to display itself.

String getIdentityName()

Return the name that uniquely identifies this column, as defined with the XML configuration for this grid.

void getPrimaryFieldName()

Returns the name of the primary field being displayed by this column.

String getPrimaryFieldType()

Returns the type of the primary field being displayed by this column.

Returns
One of the type constants defined within caplin.grid.sort.FieldSortRule.

int getSortOrder()

Returns the sort order that is currently set on this column.

Returns
One of #SORT_NONE, #SORT_ASC or #SORT_DESC.

Variant getValue(String sFieldName)

Returns the value associated with the supplied field name.

Parameters
String sFieldName The field name

int getWidth()

Returns the width that this column has been set to.

void getWidthBeforeLatestColumnWidth()

If the columns width changes this will return the value before the latest change. If the width hasn't changed then it will return the current width.

boolean isClear()

Determines whether a column is static or not.

Returns
true if this column value must always be retained when grids are hidden , and false otherwise.

boolean isFixed()

Determines whether a column is fixed or not.

Returns
true if this column is fixed in place and false otherwise.

boolean isMandatory()

Determines whether a column is optional or not.

Returns
true if this column must always be displayed within a grid, and false otherwise.

boolean isResizable()

Determines whether a column is resizable or not.

Returns
true if this column is allowed to be resized, and false otherwise.

boolean isSortable()

Return the boolean flag indicating whether or not this column can be sorted on as defined within the XML configuration for this grid column.

void setSortOrder(int nSortOrder)

Sets the sort order that this column should use for sorting.

Parameters
int nSortOrder The sort order that this column should be sorted by.

This should be #SORT_NONE for no sorting, #SORT_ASC to sort this column ascendingly, or #SORT_DESC to sort this column descendingly.

Throws
caplin.core.Error
If the specified sort order is not one of #SORT_NONE, #SORT_ASC or #SORT_DESC.

void setValue(String sFieldName, Variant vFieldValue)

Sets the value of the specified field.

Parameters
String sFieldName The field name
Variant vFieldValue The field value

void setWidth(int nWidth)

Sets the width of this column.

Parameters
int nWidth The width to set this column to.
Throws
caplin.core.Error
if the specified width is not a positive integer.