new module:ct-grid /filter /Field Filter Expression(name, operator, value, primary Field Typeopt, user Inputted Valueopt, column Idopt)
Constructs a new FieldFilterExpression
with the specified field name, operator and
value.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String | The name of the field to be filtered. |
|
operator |
String | The operator to be used for the filter. This must be one values
defined by the |
|
value |
String | The value to be operated against. |
|
primaryFieldType |
String |
<optional> |
The type of the field, can be used to set custom filter types. |
userInputtedValue |
String |
<optional> |
The value the user typed into a filter input. |
columnId |
String |
<optional> |
The id of the column that this filter applies to. |
- Implements:
Throws:
module:ct-core/Error
if the specified field name or value parameters are null
or undefined, or if the specified operator is illegal.
Implementation of FilterExpression
that represents a filter for a single field.
When this is applied, only those records that match the specified criteria will be returned,
those that don't are filtered out.
Field filter examples:
Operator | Example | |
---|---|---|
EQUAL |
Currency=USD |
Filters out all records that do not have a value of USD for their Currency field |
NOT_EQUAL |
Currency!=USD |
Filters out all records that have a value of USD for their Currency field |
GREATER_THAN |
Bid>100 |
Filters out all records that do not have a value greater than 100 for their Bid field |
GREATER_THAN_OR_EQUAL |
Bid>=100 |
Filters out all records that do not have a value greater than or equal to 100 for their Bid field |
LESS_THAN |
Bid<100 |
Filters out all records that do not have a value less than 100 for their Bid field |
LESS_THAN_OR_EQUAL |
Bid<=100 |
Filters out all records that do not have a value less than or equal to 100 for their Bid field |
REGULAR_EXPRESSION |
Currency~^(USD|EUR)$ |
Filters out all records that do not have a value of USD or EUR for their Currency field |
CASE_INSENSITIVE_REGULAR_EXPRESSION |
Issuer#.*Gov.* |
Filters out all records that do not have a value that contains the text Gov, regardless of case, for their Issuer field |
Members
(static) Operator .CASE _INSENSITIVE _REGULAR _EXPRESSION :String
Operator used to check that a string field matches a particular regular expression where an exact case match is not necessary.
The value of this operator is '#
'.
Type:
- String
(static) Operator .EQUAL :String
Operator used to check for an exact match between a field and a value. This can be used for both string and numeric based values.
The value of this operator is '=
'.
Type:
- String
(static) Operator .GREATER _THAN :String
Operator used to check that a numeric field is greater than a particular value.
The value of this operator is '>
'.
Type:
- String
(static) Operator .GREATER _THAN _OR _EQUAL :String
Operator used to check that a numeric field is greater than or equal to a particular value.
The value of this operator is '>=
'.
Type:
- String
(static) Operator .LESS _THAN :String
Operator used to check that a numeric field is less than a particular value.
The value of this operator is '<
'.
Type:
- String
(static) Operator .LESS _THAN _OR _EQUAL :String
Operator used to check that a numeric field is less than or equal to a value.
The value of this operator is '<=
'.
Type:
- String
(static) Operator .NOT _EQUAL :String
Operator used to check that a field does not match a particular value. This can be used for both string and numeric based values.
The value of this operator is '!=
'.
Type:
- String
(static) Operator .NUMERIC _EQUAL :String
Operator used to check for a numeric match between a field and a value. This can be used for numeric value only, and unlike a normal equals, entering 5.000 will match a value of 5, whereas it won't with the generic equals operator.
The value of this operator is '==
'.
Type:
- String
(static) Operator .NUMERIC _NOT _EQUAL :String
Operator used to check for a numeric match between a field and a value not to be equal. This can be used for numeric value only, and unlike a normal equals, entering 5.000 will match a value of 5, whereas it won't with the generic equals operator.
The value of this operator is '!==
'.
Type:
- String
(static) Operator .REGULAR _EXPRESSION :String
Operator used to check that a string field matches a particular regular expression.
The value of this operator is '~
'.
Type:
- String
(static) Operator .TEXT _GREATER _THAN :String
Operator used to check that a text field is greater than a particular value.
The value of this operator is 'gt
'. Its RTTP State is the field name prefixed by 'text:
' and an operator of '>
'.
Type:
- String
(static) Operator .TEXT _GREATER _THAN _OR _EQUAL :String
Operator used to check that a text field is greater than or equal to a particular value.
The value of this operator is 'ge
'. Its RTTP State is the field name prefixed by 'text:
' and an operator of '>=
'.
Type:
- String
(static) Operator .TEXT _LESS _THAN :String
Operator used to check that a text field is less than a particular value.
The value of this operator is 'lt
'. Its RTTP State is the field name prefixed by 'text:
' and an operator of '<
'.
Type:
- String
(static) Operator .TEXT _LESS _THAN _OR _EQUAL :String
Operator used to check that a text field is less than or equal to a particular value.
The value of this operator is 'le
'. Its RTTP State is the field name prefixed by 'text:
' and an operator of '<=
'.
Type:
- String
Methods
(static) get Operator For Field Key(field Key) → {String}
Returns the FieldFilterExpression operator that relates to the given key. This is a compatibility function
to provide a mapping between operators and GridColumnFilter
filter names.
Parameters:
Name | Type | Description |
---|---|---|
fieldKey |
String | The filter key to map |
Returns:
The FieldFilterExpression operator
- Type
- String
(static) is Valid Field Key(field Key) → {boolean}
Indicates whether the given key maps to a valid FieldFilterExpression
operator.
Parameters:
Name | Type | Description |
---|---|---|
fieldKey |
String | The filter key to check |
Returns:
True if the key is valid, false otherwise
- Type
- boolean
get Column Id() → {String}
Returns the id of the column that this FieldFilterExpression applies to.
Returns:
The column id.
- Type
- String
get Field Name() → {String}
Gets the field name which this filter applies to
Returns:
The field that this filter applies to
- Type
- String
get Filter Key() → {String}
Returns a textual key that represents the operator used by this expression.
Returns:
The key that represents this expression's operator
- Type
- String
get Operator() → {String}
Returns the operator
Returns:
The operator for this FieldFilterExpression
- Type
- String
get Rttp State()
Gets the serialized representation of this FieldFilterExpression
which is understood
by the Container Filtering Module used by Transformer.
Returns:
String A serialized representation of this expression.
get Serialized State(indent) → {String}
Gets the XML representation of this FieldFilterExpression
that will be used to save
it within a serialized component and/or layout.
Parameters:
Name | Type | Description |
---|---|---|
indent |
String | The number of characters the caller would like the expression to indent the XML it returns to make it easily human readable. |
Returns:
An XML representation of this expression.
- Type
- String
get User Inputted Value() → {String}
Returns the value the user typed into the filter input box if this filter was created by user input. A RegExp string may be converted from what is seen in the GUI to a string containing ^.*& etc and the grid on deserializing will need the original value to place into the input box, this method provides it.
Returns:
The user inputted value for this FieldFilterExpression.
- Type
- String
get Value() → {String}
Returns the value
Returns:
The value for this FieldFilterExpression
- Type
- String
is Mutually Exclusive With(filter Expression) → {boolean}
Indicates whether this filter is mutually exclusive with the given filter. Filters are mutually exclusive if they both share a mutually exclusive operator. The mutually exclusive operators are LESS THAN (OR EQUAL), GREATER THAN (OR EQUAL), EQUAL and NOT EQUAL.
Parameters:
Name | Type | Description |
---|---|---|
filterExpression |
module:ct-grid |
The filter to compare with this one |
Returns:
true if the filters have mutually exclusive operators, false otherwise
- Type
- boolean
matches Filter Key(filter Name) → {boolean}
Indicated whether this FieldFilterExpression matches the filter name given. This is for backwards compatibility with GridColumnFilters.
Parameters:
Name | Type | Description |
---|---|---|
filterName |
The filter name to check |
Returns:
true if this filter matches, false otherwise
- Type
- boolean
set Value(value)
Sets the value
Parameters:
Name | Type | Description |
---|---|---|
value |
The new value for the filter |
to Map() → {Object}
Construct map representing the filter. Used by InputControls
- Implements:
Returns:
A map with low/high/regex/not/numberNot/value
- Type
- Object
to String() → {String}
Gets a text representation of the field filter expression.
Returns:
A text representation of the expression.
- Type
- String