Some of Flexmonster's methods and events are not supported in Blazor out of the box (see the list of such methods and events). However, you can use JavaScript to access them.
To demonstrate this approach, let’s customize the Toolbar using JavaScript:
Step 1. In your project, go to the wwwroot/index.html file and create an empty <script> section there:
<body>
<app>Loading...</app>
<script src="_framework/blazor.webassembly.js"></script>
<script>
</script>
</body>
This section will contain your JavaScript code for Flexmonster.
Step 2. Inside the window object, create a JavaScript function and pass a Flexmonster instance to it. This instance can be used to access the Flexmonster API. For example:
<body>
<app>Loading...</app>
<script src="_framework/blazor.webassembly.js"></script>
<script>
/* The window.customizeToolbar function subscribes
Flexmonster to the beforetoolbarcreated event
*/
window.customizeToolbar = (pivot) => {
pivot.on("beforetoolbarcreated", customizeToolbarHandler);
}
function customizeToolbarHandler(toolbar) {
// Get all tabs
let tabs = toolbar.getTabs();
toolbar.getTabs = function () {
// Remove the Connect tab using its id
tabs = tabs.filter(tab => tab.id != "fm-tab-connect");
return tabs;
}
}
</script>
</body>
Step 3. Open the file with Flexmonster (e.g., Pivot.razor) and specify your JavaScript function (e.g., customizeToolbar) in the FlexmonsterComponent’s JavaScriptHandler parameter:
@page "/"
<h3>Pivot</h3>
<FlexmonsterComponent Report="@report"
Toolbar="true"
Width="100%"
Height="600"
JavaScriptHandler="customizeToolbar"
/>
The window.customizeToolbar function will be called after the Flexmonster instance is created. As a result, your customization will be applied to Flexmonster.
Can't find your answer?
Visit the FAQ
Flexmonster Pivot Table & Charts is a JavaScript pivot table component for adding interactive reporting and data analysis to web applications. Users can summarize, filter, sort, and explore data in pivot tables and charts, drill into results, and export reports.
Flexmonster works in plain JavaScript and TypeScript projects. It also integrates with React, Next.js, Angular, Vue, Blazor, and other technologies. See all integration options.
Flexmonster supports JSON and CSV files, SQL databases, MongoDB, Elasticsearch, and Microsoft Analysis Services (SSAS). You can also connect other data sources through your own backend. See supported data sources.
Flexmonster offers licenses for internal corporate use, SaaS products, and OEM distribution. Pricing varies by license and plan. SaaS projects can also use the free SaaS Entry license during development. Learn more on the pricing page.
Yes. Flexmonster offers a 30-day free trial that lets you evaluate all its features. No credit card is required. The trial version has a watermark.
To get started with Flexmonster, follow our integration guide.