Need a special offer?Find out if your project fits.
  1. API reference
  • Introduction
  • Connecting to Data Source
  • Browser compatibility
  • Documentation for older versions
  • Table of contents

    Accessing Flexmonster functionality through JavaScript

    You can use JavaScript to access Flexmonster’s features that are not supported in Blazor out of the box (see the list of such methods and events).

    To demonstrate this approach, let’s customize the Toolbar using JavaScript:

    Step 1. Go to the wwwroot/index.html file and create an empty <script> section there:

      <script src="_framework/blazor.webassembly.js"></script>

    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:

      <script src="_framework/blazor.webassembly.js"></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 => != "fm-tab-connect");
            return tabs;

    Step 3. Open the file with Flexmonster and specify your JavaScript function (e.g., customizeToolbar) in the FlexmonsterComponent’s JavaScriptHandler parameter:

    @page  "/"
    <FlexmonsterComponent Report="@report"

    The window.customizeToolbar function will be called after the Flexmonster instance is created. As a result, your customization will be applied to Flexmonster.

    See also