<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div>
<h2>Creating a custom filter area outside of Flexmonster</h2>
<p>
This example shows how to create an area with custom buttons that open
filters for fields selected in the slice.
</p>
<p>
<b>Step 1.</b> First, we create the <code>showFilters()</code> function
(lines 53-72 in the JavaScript box) that collects fields defined in the
slice using
<a href="https://www.flexmonster.com/api/getrows/" target="_blank"
>getRows()</a>,
<a href="https://www.flexmonster.com/api/getcolumns/" target="_blank"
>getColumns()</a>, and
<a href="https://www.flexmonster.com/api/getreportfilters/" target="_blank"
>getReportFilters()</a>. Then, it filters out measures and renders a button
for each field with an
<a href="https://www.flexmonster.com/api/openfilter/" target="_blank"
>openFilter()</a> call on click.
</p>
<p>
<b>Step 2.</b> In the
<a href="https://www.flexmonster.com/api/reportcomplete/" target="_blank"
>reportcomplete</a> and
<a href="https://www.flexmonster.com/api/reportchange/" target="_blank"
>reportchange</a> event handlers (lines 45-51), we call <code>showFilters()</code>
to update the list of buttons based on the current slice.
</p>
<p>
Learn more about
<a
href="https://www.flexmonster.com/doc/creating-a-custom-ui-control-or-view"
target="_blank"
>creating a custom UI control or view</a>.
</p>
</div>
<div id="filtersArea"></div>
<div id="pivotContainer"></div>