System Filter Predicates

Summary

  • AdapTable provides multiple System Predicates available for use in Column Filters
  • Developers are able to choose on a per-column basis which of these Predicates are available to their users
  • They can also select the default Predicate (for each Column or DataType)

Available System Filters

This is the full list of System Predicates shipped by AdapTable which are available for Column Filters:

Note

All includes array types as well number, text, date and boolean

PredicateColumn Data TypeNo.of Inputs
BlanksAll0
NonBlanksAll0
InAlln
NotInAlln
Equalsnumber1
NotEqualsnumber1
GreaterThannumber1
LessThannumber1
Positivenumber0
Negativenumber0
Zeronumber0
Betweennumber2
NotBetweennumber2
Istext1
IsNottext1
Containstext1
NotContainstext1
StartsWithtext1
EndsWithtext1
Regextext1
Todaydate0
Yesterdaydate0
Tomorrowdate0
ThisWeekdate0
ThisMonthdate0
ThisQuarterdate0
ThisYeardate0
InPastdate0
InFuturedate0
Beforedate1
Afterdate1
Ondate1
NotOndate1
NextWorkDaydate0
LastWorkDaydate0
WorkDaydate0
Holidaydate0
Rangedate2
Trueboolean0
Falseboolean0

Limiting System Filters

By default all Predicates shipped by AdapTable are fully available in the Module to which they are entitled.

This means that all the Predicates listed above which can be used in Filtering will be available to users.

AdapTable provides the systemFilterPredicates property in Predicate Options to override this if required.

systemFilterPredicates

Default: [all]
string[] or function
Which System Filter Predicates are available in AdapTable
System Filters
Fork
  • This demo shows how to limit which System Filter Predicates are available in AdapTable by using the systemFilterPredicates property in Predicate Options
  • It provides a function which contains this logic:
    • The Name Column will only display the Contains, EndsWith and Regex System Predicates
    • All other Columns will show whichever of the GreaterThan, LessThan, ThisMonth, ThisQuarter and In System Predicates are relevant to that Column

Expand to see how System Filters are limited

Try It Out
  • Open the various filter dropdowns and see that there is a much reduced list of Filters available
  • Open the Name dropdown and see that the list provided in the function just for that column is shown

Default Filter Predicates

AdapTable sets a default Filter Predicate to use for 4 Column Data Types.

However, each of these can be changed by using a relevant property in Column Filter Options:

Data TypeOptions PropertyDefaultAvailable Values
textdefaultTextColumnFilterContainsIs IsNot Contains NotContains In StartsWith EndsWith Regex
numericdefaultNumericColumnFilterEqualsGreaterThan LessThan Equals NotEquals In
datedefaultDateColumnFilterOnAfter Before On NotOn In
arraydefaultArrayColumnFilterInIn NotIn Blanks NonBlanks

Hint

It is also possible to set a different default Predicate for the Filter Bar and the Filter Form

Each property offers two types of return value:

Note

This is particularly useful in the Filter Bar as it sets the Predicate that is displayed by default for the Column

Default Predicates for Filters
Fork
  • This example sets the 4 different data-type related Default Predicate properties:
    • defaultNumericColumnFilter - GreaterThan for Filter Bar and LessThan for Filter Form (provided hard-coded for both, so is same for all numeric columns)
    • defaultTextColumnFilter - StartsWith for all string columns except Language which is In
    • defaultDateColumnFilter - Before for Created and Updated columns, and After for all other date columns
    • defaultArrayColumnFilter - NotIn (provided hard-coded so is same for all array columns)

Default Text Predicate

Use the defaultTextColumnFilter property to set the default Predicate for text columns.

defaultTextColumnFilter

Default: Contains
Is|IsNot|Contains|NotContains|StartsWith|EndsWith|In|Regex
Default Predicate to use for Text (string) Columns

Default Numeric Predicate

Use the defaultNumericColumnFilter property to set the default Predicate for Numeric columns.

defaultNumericColumnFilter

Default: Equals
GreaterThan|LessThan|Equals|NotEquals|In
Default Predicate to use for Numeric Columns

Default Date Predicate

Use the defaultDateColumnFilter property to set the default Predicate for Date columns.

defaultDateColumnFilter

Default: On
After|Before|On|NotOn|In
Default Predicate to use for Date Columns

Default Array Predicate

Use the defaultArrayColumnFilter property to set the default Predicate for Array (text and numeric) columns.

defaultArrayColumnFilter

Default: In
In|NotIn|Blanks|NonBlanks
Default Predicate to use for Array-based Columns