Mode based search grid plugin
The mode based search grid plugin is part of the Grid Extensions plug-in. The mode based search grid plugin adds additional ways filter Novulo grids, based on a pre-defined set of expressions.
Requirements
- The Mode based search grid plugin functionality is available starting revision 122764 of the Grid extensions
Configuration
- Place ModeBasedSearchGridPluginPanel form panel item from the GridExtensions plugin, somewhere in the component (for clarity reasons, preferably on the same page as the grid that will be filtered.
- Configuration items:
- Reference to the grid element to filter - configure this configuration item to point to the grid that will be filtered.
- Record type of grid to filter - set this to the datatype of the grid to filter that was just configured.
- Searches - this group configuration item defines the Filter expression that will be possible to apply.
-
DataTypeOfPlaceholder - this configuration item specifies the value of what datatype the input text should be converted to before it is placed in the filter expression (and that filter used).
-
Code - short code to display in the UI for the currently selected search expression.
-
Description - long description (visible when the dropdown is expanded).
-
Search expression - expression that evaluates to a boolean. This boolean expression will be used as an additional filter on the selected grid (concatenated in a logical AND with all other active grid filters, whether architect or user-defined).
Search expression contexts
The available contexts for the
SearchExpression
configuration item are as follows:- “this” (level 0) - resolves to an object of the same datatype as the Grid’s datasource (e.g., if the Grid contains Persons, this would be a Person).
- “parent.this” (level 1) - resolves to the value of the same datatype as the defined
DataTypeOfPlaceholder
. You have to manually drag “this” from the “System functions” in the expression editor pallete, drop it anywhere in the Expression editor, and then alt drag&drop under parent context - “parent.parent.this” (level 2) - resolves to the Page record (if any; otherwise, it’s
null
and should not be used if there is no page record). - “parent.parent.parent.this” (level 3) - resolves to the Page state record (always available).
-
Is initially toggled - boolean value, if set to “true” the ModeBasedSearch grid plugin would be initially enabled when opening the grid.
-
Split search terms on space. - if set to true, " " (space) in the input text field is treated as a separator, and each value after a split on the " " will be used as a value for placeholder. The current search expression is duplicated and each of the values after the split is used within the search expression. All these search expressions are combined with a logical AND between then
-
Known architect issues
You might get architect error similar to “Type error, expected String, found XXX” when you have selected, for example, string as DataTypeOfPlaceholder. In this case you need to:
- change the DataTypeOfPlaceholder to any record type
- click save on the plugin configuration panel
- open again and change back to String (or whatever other primitive)
- click save again and the architect error should be gone.
Usage
-
Go to the page which contains the grid to which the ModeBased Search grid plugin was linked
-
If the mode based search is not toggled on already, click on the Cog wheel → select Mode based search:
-
Now you see a dropdown and a text field in the grid header
- the dropdown is used to select the mode (search expression to use)
- the text field is used to enter the value to filter on
- In this case, my search expression is “Name contains”
- If i enter query “Miroslav Gechev”, with split terms on space disabled, i get a filter expression for the grid like:
boolean:and([ this.contact_name.contains(“Miroslav Gechev”)])
This results in: