Filter Components
Summary
- AdapTable provides 2 main components to allow run-time users to create Column Filters with multiple conditions
- Filter Form - a popup that contains all the functionality required to manage complex filtering
- Filter Bar - sits between the Column Header and the first row of the Grid - and designed for quick filtering
- Both components enable the IN filter to be used to select multiple column values
Column Filtering in AdapTable is done via 2 main UI components:
- Filter Form - popup offering comprehensive, multi-Predicate filtering functionality (also used in ToolPanel)
- Filter Bar - bar underneath the Column Header, designed for quick filtering
Filter Form
The Adaptable Filter Form provides a way to create powerful Filters with just a few clicks.
Every column in AdapTable will display a bespoke Filter Form.
The Filter Form contains:
- list of available Predicates for the Column (based on its data type)
- list of distinct column values (when using the In Predicate)
Add Conditionbutton to add additional predicates to the Column FilterClear FiltersbuttonApply Filterbutton (if Manually Applying Filters is turned on)
Note
The Filter Form is only displayed for Columns with filterable set to true in AG Grid GridOptions
Filter Form Locations
The AdapTable Filter Form is displayed in 2 places in the Grid:
-
As a popup that opens when clicking the Filter button in the Column Menu
-
In the Filters Tool Panel in the AG Grid sidebar (generally displayed to the right of the grid)
Filter Bar
The Filter Bar is a custom AdapTable UI Component that replaces AG Grid's Floating Filter.
It is displayed between the Column Header and the first data row in AG Grid.
Deep Dive
Setting up and Displaying the Filter Bar
The Filter Bar comprises 2 elements:
-
Predicate Dropdown - sits on the left hand side of the Filter Bar and contains all the System and Custom Filters which have Scope for that column
-
Input Control - if the selected Predicate requires
inputs, a control appears enabling these to be enteredNote
- The type of the input control varies depending on the Data Type of the Column
- A TextBox is used for strings, a Date Picker for dates, and a Numeric Editor for numbers
Hint
- If the selected Predicate requires no inputs (e.g.
Today), its name is displayed here instead - If the selected Predicate requires 2 values (e.g.
Between) then 2 inputs are displayed
IN Predicate
The IN predicate differs to other predicates as it can receive multiple column values.
When this predicate is selected, AdapTable changes the input box to 'Select Values', and AdapTable lists the distinct values for the column with a checkbox by each.
Users are then able to provide the inputs to the IN Predicate by selecting the checkboxes they require.
Find Out More
See the Guide to the In Filter for more information, including how to display custom values
Wildcards
Wildcards are available in the Filter Bar to speed up filtering, and reduce mouse usage.
For example, you can type '>' in a numeric input to jump to the GreaterThan Predicate.
The 6 wildcards provided by AdapTable are:
| Wildcard | Predicate | Available Columns |
|---|---|---|
= | Equals | Text, Number |
> | GreaterThan | Number |
< | LessThan | Number |
: | Between | Number |
[ | In | All Columns |
# | In | All Columns |
quickFilterWildcards
Default: 6 wildcards provided by AdapTable- This Demo shows how to manage Wildcards in the Filter Bar:
- an empty array has been provided for
In- so that neither of the System wildcards for that Predicate are operable - a value of '!' has been provided for the NotEquals Predicate - so that entering that in a number column will change the Predicate automatically
- an empty array has been provided for
- Type '[' or '#' in the
Languagecolumn and see that theInpredicate does not appear - Type '!' in
Github Starscolumn and note that the Predicate changes toNotEquals
Hiding the Filter Bar
The Filter Bar can be hidden or made visible, both at design time and run time.
- Design-time visibility is provided via the
showQuickFilterproperty in Column Filter Options
showQuickFilter
Default: trueboolean- Run-time Filter Bar visbility can be handled in various ways including:
- Checking / unchecking the
Quick Filter Checkboxin the Filter Toolbar - Checking / unchecking the
Quick Filter Checkboxin the Filter Tool Panel - Accessing the
Show / Hide Quick Filter BarColumn Menu Item
- Checking / unchecking the
Caution
- Filter Bar Visibiilty which is changed mid-session is not subsequently persisted, as it is not part of Adaptable State
- However, you can easily save and restore Filter Bar visbility by using the Application section of Adaptable State
Hiding Filter Bar Elements
As well as hiding the Filter Bar entirely, the constituent elements can also be hidden.
Note
They can be hidden on a column by column basis
This is achieved using 2 functions in Filter Options:
hideQuickFilterDropdown- which hides the dropdown on the left of each Column's Floating BarhideQuickFilterInput- which is the main input where text is entered
hideQuickFilterInput
booleanhideQuickFilterDropdown
booleanFilter Bar Debounce
By default AdapTable will apply Filters every 250ms in response to user entry in the Filter Bar.
Where this is too quick, e.g. if running Filters on the Server and less frequent Filtering is required, the quickFilterDebounce property in Filter Options can be used.
Note
This differs from filterActionOnDataChange property which sets whether the Grid re-filters after changes in Grid Data
quickFilterDebounce
Default: 250number- This Demo illustrates 2 Column Filter Options available for configuring the Filter Bar:
- an implementation provided for
hideQuickFilterDropdownproperty so that the dropdown does not appear in Boolean columns - an implementation provided for
hideQuickFilterInputproperty so that the input is hidden from the License column
- an implementation provided for
Filter Bar Height
AdapTable will set the height of the Filter Bar to the AG Grid default.
If that is not required, the height can be set using the quickFilterHeight property in Filter Options:
quickFilterHeight
numberOther Filter Components
In addition to the 2 main Filter Components, AdapTable provides 4 additional filter-related components:
Each of these components allow run-time Users to:
- see which Column Filters are active
- clear Column Filters
- Suspend / Reactivate Columns
- Open the Filter Form (to edit Column Filters)
FAQ
Can we change the Filter Bar Predicate without using the Dropdown Yes, wildcards are available for the more commonly used Predicates
The Filter Bar is disabled, why is that? Check that you have not set Manually Applying Filters as this will disable the Filter Bar