Managing Expressions

View as Markdown

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: undefined
function
Control which Expression Functions are available (globally, per Module, or per Column)
AdapTableQL: Limiting Functions
Fork

Expand to see the Expressions removed

Loading demo…

Limiting 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: true
Boolean
Whether a Column should be included in AdapTableQL Expressions

Note

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

AdapTableQL: Limiting Columns
Fork
  • In this example we have provided an implementation for the isColumnQueryable property to prevent these columns from being used in Expressions:
    • The License Column
    • All Date Columns

Expand to see how Queryable Columns were set

Try It Out
  • 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
Loading demo…

Case Sensitivity

By default Expressions are case insensitive.

Set caseSensitiveExpressions in ExpressionOptions to true to change that.

caseSensitiveExpressions

Default: false
Boolean
Keep case sensitivity when AdapTableQL evaluates string-based Expressions

Date 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: false
boolean | ((context: AdaptableColumnContext) => boolean)
Compare dates as a full timestamp rather than a calendar day