Your search did not match any results.
Pivot Grid

Header Filter

A header filter allows a user to filter field values by including or excluding them from the applied filter. Click a header filter icon in the field chooser or on the field panel to open a popup menu that displays all unique field values.

Use the following options to configure the header filter:

  • allowSearch
    Enables a user to search through field values.

  • showRelevantValues
    Specifies whether to show all field values or only those that satisfy the other applied filters.

  • width and height
    Configures the popup menu size.

In this demo, a filter is applied to the Country field. This filter includes only the United Kingdom. The City field displays only cities in this country because the showRelevantValues option is true. If you clear the corresponding checkbox under the widget, the City field displays all cities, regardless of the other applied filters.

Copy to CodePen
Apply
Reset
$(function(){ var salesPivotGrid = $("#sales").dxPivotGrid({ allowFiltering: true, allowSorting: true, allowSortingBySummary: true, height: 570, showBorders: true, headerFilter: { allowSearch: true, showRelevantValues: true, width: 300, height: 400 }, fieldChooser: { allowSearch: true }, fieldPanel: { visible: true }, dataSource: { fields: [ { dataField: "[Product].[Category]", area: "column" }, { dataField: "[Product].[Subcategory]", area: "column" }, { dataField: "[Customer].[City]", area: "row" }, { dataField: "[Measures].[Customer Count]", area: "data" }, { dataField: "[Customer].[Country]", area: "filter", filterValues: ["[Customer].[Country].&[United Kingdom]"] }, { dataField: "[Ship Date].[Calendar Year]", area: "filter", filterValues: ["[Ship Date].[Calendar Year].&[2004]"] } ], store: { type: "xmla", url: "https://demos.devexpress.com/Services/OLAP/msmdpump.dll", catalog: "Adventure Works DW Standard Edition", cube: "Adventure Works" } } }).dxPivotGrid("instance"); $("#allow-search").dxCheckBox({ text: "Allow Search", value: true, onValueChanged: function(data) { salesPivotGrid.option("headerFilter.allowSearch", data.value); } }); $("#show-relevant-values").dxCheckBox({ text: "Show Relevant Values", value: true, onValueChanged: function(data) { salesPivotGrid.option("headerFilter.showRelevantValues", data.value); } }); });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/19.1.4/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/19.1.4/css/dx.light.css" /> <script src="https://cdn3.devexpress.com/jslib/19.1.4/js/dx.all.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="sales"></div> <div class="options"> <div class="caption">Options</div> <div class="option"> <div id="allow-search"></div> </div> <div class="option"> <div id="show-relevant-values"></div> </div> </div> </div> </body> </html>
#sales { max-height: 570px; } .options { padding: 20px; margin-top: 20px; background-color: rgba(191, 191, 191, 0.15); } .caption { font-size: 18px; font-weight: 500; } .option { width: 24%; display: inline-block; margin-top: 10px; }