Constructor
new module:caplin/grid/GridColumn(columnModel, properties, filtersopt)
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 module:caplin/grid/GridComponentFactory
class.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
columnModel |
module:caplin/grid/GridColumnModel | The column model that this column is a member of. | |||||||||||||||||||||||||||
properties |
Map | A map of all the properties extracted from the XML configuration.
Properties
|
|||||||||||||||||||||||||||
filters |
Array.<module:caplin/grid/GridColumnFilter> |
<optional> |
[] | The list of filter instances that will be applied to the column. |
Throws:
-
If the specified width is not a number, or the properties are invalid.
Members
-
(static, readonly) SORT_ASC :integer
-
The constant definition used when invoking
module:caplin/grid/GridColumn#setSortOrder
and requesting an ascending sort.Type:
- integer
-
(static, readonly) SORT_DESC :integer
-
The constant definition used when invoking
module:caplin/grid/GridColumn#setSortOrder
and requesting a descending sort.Type:
- integer
-
(static, readonly) SORT_NONE :integer
-
The constant definition used when invoking
module:caplin/grid/GridColumn#setSortOrder
and requesting no sort at all.Type:
- integer
Methods
-
addFilter(filterType, filterValue)
-
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
LESS_THAN
,GREATER_THAN
,EXACT_MATCH
,PARTIAL_MATCH
,WILDCARD
,WILDCARD_CASE_SENSITIVE
,REGULAR_EXPRESSION
andREGULAR_EXPRESSION_CASE_INSENSITIVE
.Parameters:
Name Type Description filterType
integer The type of filter to apply to this column. filterValue
string The value that will be used to filter this column with. -
clearFilters()
-
Removes all the filters that this column is currently using to filter values with.
-
createElementRenderer() → {module:caplin/element/Renderer}
-
Returns:
a new instance of the renderer this column uses to perform cell rendering. -
createHeaderElementRenderer(fieldNames) → {module:caplin/element/Renderer}
-
Parameters:
Name Type Description fieldNames
Array.<string> The field names to pass to the renderer. Returns:
a new instance of the renderer this column uses to perform header rendering. -
getCellRendererType()
-
Returns the Cell Renderer Type for this column.
Returns:
Object -
getClassNames() → {string}
-
Returns:
the css class names that this column will use to display itself.- Type
- string
-
getColumnIndex() → {integer}
-
Returns:
the index of the column within the column model, ornull
if the column is not currently an active column within the model.- Type
- integer
-
getColumnModel() → {module:caplin/grid/GridColumnModel}
-
Returns:
the underlying grid column model that this column is a member of. -
getFieldNames() → {Array.<string>}
-
Returns:
The list of field names required by this column.- Type
- Array.<string>
-
getFilterExpressions() → {Array.<module:caplin/grid/filter/FilterExpression>}
-
Returns all the filter expressions that this column is currently using to perform row filtering with. These may be more useful than GridColumnFilters because they contain the userInputtedValue.
Returns:
the array of filter expression instances.- Type
- Array.<module:caplin/grid/filter/FilterExpression>
-
getFilters() → {Array.<module:caplin/grid/GridColumnFilter>}
-
Returns all the filters that this column is currently using to perform row filtering with.
Returns:
the array of filter instances.- Type
- Array.<module:caplin/grid/GridColumnFilter>
-
getFriendlyName() → {string}
-
Returns:
the friendly name that this column will use to display itself.- Type
- string
-
getHeaderRendererName() → {string}
-
Returns:
the Header Renderer Name for this column.- Type
- string
-
getHeaderRendererType()
-
Returns the Header Renderer Type for this column.
Returns:
Object -
getIdentityName() → {string}
-
Returns:
the name that uniquely identifies this column (as defined with the XML configuration for this grid).- Type
- string
-
getPrimaryFieldName() → {string}
-
Returns:
the name of the primary field being displayed by this column.- Type
- string
-
getPrimaryFieldType() → {string}
-
Returns:
the type of the primary field being displayed by this column (one of the type constants defined withinmodule:caplin/grid/sort/FieldSortRule
).- Type
- string
-
getSortOrder() → {integer}
-
Returns the sort order that is currently set on this column.
Returns:
One ofmodule:caplin/grid/GridColumn.SORT_NONE
,module:caplin/grid/GridColumn.SORT_ASC
ormodule:caplin/grid/GridColumn.SORT_DESC
.- Type
- integer
-
getValue(fieldName)
-
Returns the value associated with the supplied field name.
Parameters:
Name Type Description fieldName
string The field name -
getWidth() → {integer}
-
Returns:
the defined width of the column.- Type
- integer
-
getWidthBeforeLatestColumnWidth() → {integer}
-
Returns:
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.- Type
- integer
-
isClear() → {boolean}
-
Determines whether a column is static or not.
Returns:
true
if this column value must always be retained when grids are hidden , andfalse
otherwise.- Type
- boolean
-
isFixed() → {boolean}
-
Determines whether a column is fixed or not.
Returns:
true
if this column is fixed in place andfalse
otherwise.- Type
- boolean
-
isMandatory() → {boolean}
-
Determines whether a column is optional or not.
Returns:
true
if this column must always be displayed within a grid, andfalse
otherwise.- Type
- boolean
-
isResizable() → {boolean}
-
Determines whether a column is resizable or not.
Returns:
true
if this column is allowed to be resized, andfalse
otherwise.- Type
- boolean
-
isSortable() → {boolean}
-
Returns:
the flag indicating whether or not this column can be sorted on (defined within the XML configuration for this grid column).- Type
- boolean
-
setSortOrder(sortOrder)
-
Sets the sort order that this column should use for sorting.
Parameters:
Name Type Description sortOrder
integer The sort order that this column should be sorted by. This should be
module:caplin/grid/GridColumn.SORT_NONE
for no sorting,module:caplin/grid/GridColumn.SORT_ASC
to sort this column ascendingly, ormodule:caplin/grid/GridColumn.SORT_DESC
to sort this column descendingly.Throws:
-
If the specified sort order is not one of
module:caplin/grid/GridColumn.SORT_NONE
,module:caplin/grid/GridColumn.SORT_ASC
ormodule:caplin/grid/GridColumn.SORT_DESC
.
-
-
setValue(fieldName, vFieldValue)
-
Sets the value of the specified field.
Parameters:
Name Type Description fieldName
string The field name vFieldValue
Variant The field value -
setWidth(width)
-
Sets the width of this column.
Parameters:
Name Type Description width
integer The width to set this column to. Throws:
-
if the specified width is not a positive integer.
-