Managing Expressions
Summary
- AdapTable allows developers to reduce the AdapTableQL functionality on offer to users
- This is often the case if you are evaluating Expressions yourself externally instead of using AdapTableQL
- In particular 2 features are provided:
- Make some Expression Functions unavailable in the Expression Editor and for AdapTableQL evaluation
- Specify that certain Columns cannot be included in Expressions
Reducing Expression Complexity
AdapTable provides a couple of helpful features to reduce the complexity of the Expressions available to users.
Hint
This is particularly useful if you are evaluating Expressions on the Server using your own translation
Limiting Available AdapTableQL Functions
By default all Expression Functions are available in the Expression Editor and available for the AdapTableQL evaluation engine.
Use isExpressionFunctionAvailable in Expression Options to hide functions globally, per Module, or (for Column Filter) per Column.
isExpressionFunctionAvailable
Default: undefinedfunctionLimiting Queryable Columns
By default all Columns in AdapTable can be used in a Query.
To specify whether or not a given column is Queryable, provide an implementation for the isColumnQueryable property of Expression Options.
isColumnQueryable
Default: trueBooleanNote
If no implementation is provided, all Columns can be used in Expressions
Hint
Use filter and floatingFilter properties in GridOptions to set which Columns can be filtered
- In this example we have provided an implementation for the
isColumnQueryableproperty to prevent these columns from being used in Expressions:- The
LicenseColumn - All
DateColumns
- The
Expand to see how Queryable Columns were set
- Open the Grid Filter (by clicking the arrows icon in the Grid Filter toolbar)
- In both the Expression Editor and the Query Builder, note that License and all Date Columns are absent from the Column list
Case Sensitivity
By default Expressions are case insensitive.
Set caseSensitiveExpressions in ExpressionOptions to true to change that.
caseSensitiveExpressions
Default: falseBooleanDate Comparisons
By default date Expressions compare calendar days, not the full timestamp.
Set evaluateDatesUsingTime in ExpressionOptions to true to compare the exact instant.
evaluateDatesUsingTime
Default: falseboolean | ((context: AdaptableColumnContext) => boolean)