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 Condition button to add additional predicates to the Column Filter
  • Clear Filters button
  • Apply Filter button (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 entered

    Note

    • 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:

WildcardPredicateAvailable Columns
=EqualsText, Number
>GreaterThanNumber
<LessThanNumber
:BetweenNumber
[InAll Columns
#InAll Columns

quickFilterWildcards

Default: 6 wildcards provided by AdapTable
Shortcut Keys to activate a Filter Bar Predicate
Filter Bar Wildcards
Fork
  • 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
Try It Out
  • Type '[' or '#' in the Language column and see that the In predicate does not appear
  • Type '!' in Github Stars column and note that the Predicate changes to NotEquals

Hiding the Filter Bar

The Filter Bar can be hidden or made visible, both at design time and run time.

showQuickFilter

Default: true
boolean
Whether to display Filter Bar between Column Header and the Grid (provided its been setup)
  • Run-time Filter Bar visbility can be handled in various ways including:

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 Bar
  • hideQuickFilterInput - which is the main input where text is entered

hideQuickFilterInput

boolean
Don't show the Filter Bar Dropdown for some Columns

hideQuickFilterDropdown

boolean
Don't show the Filter Bar Dropdown for some Columns

Filter 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: 250
number
Time to wait before applying the Filter after entering a value
Filter Bar Configuration
Fork
  • This Demo illustrates 2 Column Filter Options available for configuring the Filter Bar:
    • an implementation provided for hideQuickFilterDropdown property so that the dropdown does not appear in Boolean columns
    • an implementation provided for hideQuickFilterInput property so that the input is hidden from the License column

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

number
Sets height of Filter Bar (if not provided AG Grid default is used)

Other 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