Need a special offer?Find out if your project fits.
+
All documentation
  • Introduction
  • Connecting to Data Source
  • Browser compatibility
  • Documentation for older versions
  • Filter by selection

    Filter by selection allows choosing specific field members to display. 

    About the filter

    The filter by selection can be used to:

    Availability for data sources

    The filter by selection is available for all data sources.

    Note For the custom data source API, the filter by selection must be implemented on your server. For more details, refer to the Implementing filters guide.

    Applying the filter

    The filter by selection can be:

    • Applied via UI
    • Preset in the report
    • Applied using API calls

    Via UI

    Selection filter can be applied via UI in the following ways:

    Using the filter view

    Step 1. Open the filter view by clicking the field’s name or using the field’s context menu.

    Step 2. Use the checkboxes to select field members that should be displayed or hidden.

    You can also filter members using the search box. For more details, refer to the Advanced tips guide.

    The screenshot below shows an example of a filter configuration:

    Step 3. Once the filter is configured, click the APPLY button to save your configuration.

    Using a context menu

    Open a field member’s context menu and choose one of the following options:

    • Filter by the member. Create a selection filter that shows only the chosen member. 
    • Exclude the member. Create a selection filter that hides the chosen member.

    In the report

    If you want to preset a filter in your report, we recommend the following approach:

    1. Configure the filter via UI.
    2. Save the report

    Your report will now contain the filter configuration. If needed, you can edit the filter configuration programmatically. To learn more, see the FilterObject.

    If the filter by selection contains only non-existent members, it is ignored and all the field members are displayed. To change this behavior and show an empty grid, see the Advanced tips guide.

    Using API calls

    To set or change the filter at runtime, use the setFilter() API call:

    flexmonster.setFilter("Country", {
      members: [
        "country.[poland]",
        "country.[uk]",
        "country.[ukraine]",
      ],
    });

    You can view the existing filter configuration using the getFilter() method.

    Try a live sample on JSFiddle.

    If the filter by selection contains only non-existent members, it is ignored and all the field members are displayed. To change this behavior and show an empty grid, see the Advanced tips guide.

    Note Filter by selection is ignored for fields with only one member.

    Clearing the filter

    Learn how to clear the filter by selection:

    Via UI

    Step 1. Open the filter view by clicking the field’s name or using the field’s context menu.

    Step 2. Select the Select all checkbox to choose all members:

    Step 3. Click the APPLY button to save your changes.

    Using API calls

    You can clear all filters from a field using the clearFilter() API call. For example:

    flexmonster.clearFilter("Country");

    Try a live sample on JSFiddle.

    See also