Filtering
Disabling operators
Disable filtering without any code in the field settings in the Forest UI.
Substitution
Operation substitution serves two purposes:- Performance: provide a more efficient way to perform a given filtering operation
- Capabilities: enable filtering on a computed field or other non-filterable fields
Operators to support to enable search
| Column Type | Operator to support |
|---|---|
| Number | Equal |
| Enum | Equal |
| String | IContains OR Contains OR Equal |
| Uuid | Equal |
replaceFieldOperator method to unlock the operators.
Emulation
Filtering emulation allows making fields filterable automatically. It is a convenient way to get things working quickly for collections that have a low number of records (in the thousands at most).Sorting
Depending on the data source, not all fields may be sortable, or you may want to change how the native sorting works. Use thereplaceFieldSorting and emulateFieldSorting methods to change a single column’s sorting behavior.
Substitution
Provide replacement sort clauses. In this example, we’re telling Forest “When a user sorts by full name, I want to sort by the last name, and then by the first name”.creationDate is equivalent to sorting by the primary key in reverse order.
Using sort substitution where needed can save you from adding many indexes to your database.