Server-Side Row Model - Grid Filter
Summary
- The Grid Filter needs to be evaluated remotely when using the Server-Side Row Model
- AdapTable provides the current Grid Filter Expression and AST so you can pass them to the server
- Custom Expression Functions and Named Queries work the same way — only the evaluation is remote
When using the Server-Side Row Model, AG Grid will not perform any filtering.
The Grid Filter can still be applied, but instead of AdapTableQL evaluating the Expression automatically, it is performed by developers on the server.
Hint
- The Grid Filter can also include Custom Expression Functions provided by developers
- These will also then need to be evaluated remotely in a bespoke implementation
Find Out More
Column Filtering covers Column Filters, In Filter values, and how to retrieve Filter State via getAdaptableFilterState
Getting Filter State
Inside getRows, send the current Grid Filter to the server using getAdaptableFilterState in the State API.
The returned AdaptableFilterState includes gridFilter (the Expression string) and gridFilterAST (the AST to evaluate remotely).
Note
The Grid Filter Applied Event still fires, but is rarely subscribed to when using the SSRM
Limiting Expression Complexity
By default AdapTable will provide every AdapTableQL Expression Functions in the Expression Editor.
This means bespoke server implementations will need to translate every Expression into something meaningful.
Accordingly, AdapTable allows developers to reduce Expression complexity in 2 ways in order to make the server implementation more manageable:
- Limiting which Expressions are available (on a per Module basis if required)
- Limiting which Columns can be included in a Query / Expression
- The example shows how the AdapTable Grid Filter can still be used while using Server-Side Row Model
- We include 3 Named Queries which are evaluated on our mock server (and accessible from dropdown at end of toolbar):
US Golds- returns rows where USA has > 1 goldEuropean Athletes- returns rows where country is in Europe (and uses a Custom Boolean Expression Function,FROM_EUROPE, that is also evaluated on our mock server)5 Medals- returns rows where Gold + Silver + Bronze is greater than 5
- We provide an implementation of
isExpressionFunctionAvailablein Expression Options to show how to limit which Grid Filter expression functions are available
- Apply the 3 Named Queries from the Grid Filter toolbar (or write your own) and note the SQL sent to the server