Constructor
new module:ct-grid /Grid Column(column Model, properties, filtersopt)
Constructs a 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:ct-grid/GridComponentFactory
class.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
columnModel |
module:ct-grid |
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 |
<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.
- Type
-
module:ct-core
/Error
Members
(static, readonly) SORT _ASC :integer
The constant definition used when invoking module:ct-grid/GridColumn#setSortOrder
and
requesting an ascending sort.
Type:
- integer
(static, readonly) SORT _DESC :integer
The constant definition used when invoking module:ct-grid/GridColumn#setSortOrder
and
requesting a descending sort.
Type:
- integer
(static, readonly) SORT _NONE :integer
The constant definition used when invoking module:ct-grid/GridColumn#setSortOrder
and
requesting no sort at all.
Type:
- integer
Methods
add Filter(filter Type, filter Value)
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
and
REGULAR_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. |
clear Filters()
Removes all the filters that this column is currently using to filter values with.
create Element Renderer() → {module:ct-element /Renderer}
Returns:
a new instance of the renderer this column uses to perform cell rendering.
create Header Element Renderer(field Names) → {module:ct-element /Renderer}
Parameters:
Name | Type | Description |
---|---|---|
fieldNames |
Array |
The field names to pass to the renderer. |
Returns:
a new instance of the renderer this column uses to perform header rendering.
get Cell Renderer Type()
Returns the Cell Renderer Type for this column.
Returns:
Object
get Class Names() → {string}
Returns:
the css class names that this column will use to display itself.
- Type
- string
get Column Index() → {integer}
Returns:
the index of the column within the column model, or null
if the column is not currently an active column within the model.
- Type
- integer
get Column Model() → {module:ct-grid /Grid Column Model}
Returns:
the underlying grid column model that this column is a member of.
get Field Names() → {Array.< string>}
Returns:
The list of field names required by this column.
- Type
-
Array
.<string>
get Filter Expressions() → {Array.< module:ct-grid /filter /Filter Expression>}
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:ct-grid /filter /Filter Expression>
get Filters() → {Array.< module:ct-grid /Grid Column Filter>}
Returns all the filters that this column is currently using to perform row filtering with.
Returns:
the array of filter instances.
- Type
-
Array
.<module:ct-grid /Grid Column Filter>
get Friendly Name() → {string}
Returns:
the friendly name that this column will use to display itself.
- Type
- string
get Header Renderer Name() → {string}
Returns:
the Header Renderer Name for this column.
- Type
- string
get Header Renderer Type()
Returns the Header Renderer Type for this column.
Returns:
Object
get Identity Name() → {string}
Returns:
the name that uniquely identifies this column (as defined with the XML configuration for this grid).
- Type
- string
get Primary Field Name() → {string}
Returns:
the name of the primary field being displayed by this column.
- Type
- string
get Primary Field Type() → {string}
Returns:
the type of the primary field being displayed by this column (one
of the type constants defined within module:ct-grid/sort/FieldSortRule
).
- Type
- string
get Sort Order() → {integer}
Returns the sort order that is currently set on this column.
Returns:
One of module:ct-grid/GridColumn.SORT_NONE
,
module:ct-grid/GridColumn.SORT_ASC
or module:ct-grid/GridColumn.SORT_DESC
.
- Type
- integer
get Sort Type() → {string}
Returns:
the name of the sort type, will return the primary field type if a custom sort type was not defined.
- Type
- string
get Value(field Name)
Returns the value associated with the supplied field name.
Parameters:
Name | Type | Description |
---|---|---|
fieldName |
string | The field name |
get Width() → {integer}
Returns:
the defined width of the column.
- Type
- integer
get Width Before Latest Column Width() → {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
is Clear() → {boolean}
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.
- Type
- boolean
is Fixed() → {boolean}
Determines whether a column is fixed or not.
Returns:
true
if this column is fixed in place and
false
otherwise.
- Type
- boolean
is Mandatory() → {boolean}
Determines whether a column is optional or not.
Returns:
true
if this column must always be displayed within a
grid, and false
otherwise.
- Type
- boolean
is Resizable() → {boolean}
Determines whether a column is resizable or not.
Returns:
true
if this column is allowed to be resized, and
false
otherwise.
- Type
- boolean
is Sortable() → {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
set Filters(…filtersopt)
Clears the current filters and adds a new set. Equivalent to clearing and then adding the individual filters except it only results in a single subscription.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
filters |
module:ct-grid |
<optional> <repeatable> |
The list of filter instances that will be applied to the column. |
set Sort Order(sort Order)
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 |
Throws:
-
If the specified sort order is not one of
module:ct-grid/GridColumn.SORT_NONE
,module:ct-grid/GridColumn.SORT_ASC
ormodule:ct-grid/GridColumn.SORT_DESC
. - Type
-
module:ct-core
/Error
set Value(field Name, vField Value)
Sets the value of the specified field.
Parameters:
Name | Type | Description |
---|---|---|
fieldName |
string | The field name |
vFieldValue |
Variant | The field value |
set Width(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.
- Type
-
module:ct-core
/Error