Show an empty grid when filtering by members that do not exist in the dataset (for versions 2.9.86 and later)

Options

by Flexmonster Pivot Table

HTML

<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<div>
  <h2>
    Show an empty grid when filtering by members that do not exist in the
    dataset (for versions 2.9.86 and later)
  </h2>
  <p>
    By default, if you apply the
    <a
      href="https://www.flexmonster.com/doc/filter-by-selection/"
      target="_blank"
    >selection filter</a> only with members that do not exist in the dataset, 
    the filter will be ignored, and all the field members will be displayed.
  </p>
  <p>
    In this example, this behavior is changed by setting the
    <a
      href="https://www.flexmonster.com/api/options-object/#filter-allowemptymembersfilter"
      target="_blank"
    >filter.allowEmptyMembersFilter</a> option to <code>true</code> 
    (line 11 in the JavaScript box). Use this approach to show an empty grid 
    when filtering by members that might not exist if you are using 
    the <code>"json"</code> or <code>"csv"</code> data source type and 
    Flexmonster version 2.9.86 or later.
  </p>
  <p>
    <a href="https://jsfiddle.net/flexmonster/mxqv3s26/" target="_blank"
    >Check out an example of how to change this behavior for any data source
    type and Flexmonster version</a>.
  </p>
</div>

<div id="pivot-container"></div>

CSS

@import url(https://cdn.flexmonster.com/assets/jsfiddle-styles.css);

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  height: 430,
  report: {
    dataSource: {
      filename: "https://cdn.flexmonster.com/data/data.csv"
    },
    options: {
      filter: {
      	allowEmptyMembersFilter: true
      }
    },
    slice: {
      rows: [{
        uniqueName: "Category",
        filter: {
        	members: ["Computers", "Phones"]
        }
      }],
      columns: [{
        uniqueName: ["Measures"]
      }],
      measures: [{
        uniqueName: "Price",
        aggregation: "Sum"
      }]
    }
  }
});