Core Features

Advanced Features

JavaScript Data GridAdvanced Filter - Input & Builder

Version 36.2.0
Enterprise

This section describes the grid options that configure the Advanced Filter input, where it is displayed, and the Advanced Filter Builder.

Advanced Filter Input Copy Link

The buttons shown in the Advanced Filter input and the element it is displayed in can both be configured.

Buttons Copy Link

It is possible to customise the buttons displayed in the Advanced Filter, allowing for the use of other Filter Buttons such as Reset, Cancel and Clear. Configure via the grid option advancedFilterParams which follows the IAdvancedFilterParams interface:

buttonsCopy Link
FilterAction[]
default: ['apply']
Specifies the buttons to be shown in the Advanced Filter, in the order they should be displayed in. The options are:
  • 'apply': The Apply button will apply the filter.
  • 'clear': The Clear button will clear the filter input without removing the current active filter.
  • 'reset': The Reset button will clear the filter and apply an empty filter.
  • 'cancel': The Cancel button will discard any changes that have been made to the filter in the UI, restoring the applied model.
  • suppressBuilderButtonCopy Link
    boolean
    default: false
    Whether to hide the Builder button to open the Advanced Filter Builder

    The following example demonstrates configuring the Advanced Filter:

    • The Builder button has been removed via suppressBuilderButton. The Builder can still be opened via the API.
    • The buttons have been configured to add the Clear and Reset buttons.

    Filter Parent Copy Link

    By default the Advanced Filter is displayed underneath the Column Headers. To display the Advanced Filter outside of the grid (such as above it), set the grid option advancedFilterParent. The Popup Parent must also be set to an element that contains both the Advanced Filter parent and the grid.

    advancedFilterParentCopy Link
    DOM element to use as the parent for the Advanced Filter to allow it to appear outside of the grid. Set to null or undefined to appear inside the grid.

    The following example demonstrates displaying the Advanced Filter outside of the grid:

    • The Advanced Filter parent is set using an element directly above the grid.
    • Popup Parent is set to the document body.

    Advanced Filter Builder Copy Link

    The Advanced Filter Builder can be configured via the grid option advancedFilterBuilderParams which follows the IAdvancedFilterBuilderParams interface:

    addSelectWidthCopy Link
    number
    default: 120
    Width in pixels of the Advanced Filter Builder add button select popup.
    buttonsCopy Link
    FilterAction[]
    default: ['apply', 'cancel']
    Specifies the buttons to be shown in the Advanced Filter Builder, in the order they should be displayed in. The options are:
  • 'apply': The Apply button will apply the filter and close the builder.
  • 'clear': The Clear button will clear the filter in the builder without removing the current active filter.
  • 'reset': The Reset button will clear the filter and apply an empty filter.
  • 'cancel': The Cancel button will discard any changes that have been made to the filter in the UI, and close the Builder without applying any changes.
  • minWidthCopy Link
    number
    default: 500
    Minimum width in pixels of the Advanced Filter Builder popup.
    pillSelectMaxWidthCopy Link
    number
    Max width in pixels of the Advanced Filter Builder pill select popup. Unset, the popup grows to its widest option, bounded by the width of the Advanced Filter Builder.
    pillSelectMinWidthCopy Link
    number
    default: 140
    Min width in pixels of the Advanced Filter Builder pill select popup.
    showMoveButtonsCopy Link
    boolean
    default: false
    Whether to show the move up and move down buttons in the Advanced Filter Builder.
    suppressFullScreenButtonCopy Link
    boolean
    default: false
    Whether to hide the Full Screen button in the Advanced Filter Builder.

    Launch via API Copy Link

    As well as using the button in the Advanced Filter, it's possible to launch the Advanced Filter Builder via the showAdvancedFilterBuilder grid API method, and hide it via hideAdvancedFilterBuilder:

    showAdvancedFilterBuilderCopy Link
    Function
    Open the Advanced Filter Builder dialog (if enabled).
    hideAdvancedFilterBuilderCopy Link
    Function
    Closes the Advanced Filter Builder dialog (if enabled). Un-applied changes are discarded.

    Events Copy Link

    When the Advanced Filter Builder is shown or hidden, the advancedFilterBuilderVisibleChanged event is fired:

    advancedFilterBuilderVisibleChangedCopy Link
    AdvancedFilterBuilderVisibleChangedEvent
    Advanced Filter Builder visibility has changed (opened or closed).

    The following example demonstrates configuring the Advanced Filter Builder:

    • The Advanced Filter Builder button displays the Advanced Filter Builder via the API method showAdvancedFilterBuilder.
    • The advancedFilterBuilderVisibleChanged event is used to toggle the disabled status of the Advanced Filter Builder button.
    • The showMoveButtons param is set in the advancedFilterBuilderParams, which displays buttons allowing the filter rows to be moved up and down (including via keyboard navigation).

    Localisation Copy Link

    If providing custom Localisation values for the Advanced Filter, note that if the filter option values contain spaces, one option value cannot start with another option value.