Flexmonster Software License Agreement (“Agreement”) has been significantly revised and is effective as of September 30, 2024.
The following modifications were made:
The modified version of Flexmonster Software License Agreement is available here.
Downloading, installing, and/or continuing to use Flexmonster Software after September 30, 2024, constitutes Licensee’s acceptance of the terms and conditions of the modified version of Flexmonster Software License Agreement. If Licensee does not agree to any of these terms and conditions, they must cease using Flexmonster Software and must not download, install, use, access, or continue to access Flexmonster Software. By continuing to use Flexmonster Software or renewing the license under License Model or Maintenance after the effective date of any modifications to Agreement, Licensee accepts and agrees to be bound by the terms and conditions of the modified Agreement.
This guide explains how to use Flexmonster methods and events. First, we will get a reference to the Flexmonster instance. Then we will use this reference to call methods and subscribe to events.
To interact with Flexmonster via its API, you need a reference to the Flexmonster instance. Get the reference during or after the initialization:
When calling the new Flexmonster() constructor, assign its result to a variable:
const pivot = new Flexmonster({ // … });
Get the reference to the Flexmonster instance via the uielement
property of the component’s container:
const pivot = document.getElementById("flexmonsterContainer").uielement.flexmonster;
Now the pivot
variable contains a reference to the Flexmonster instance. Use the pivot
to access Flexmonster API.
Call Flexmonster methods using the reference to the Flexmonster instance:
pivot.setReport(report);
Some methods can also be defined as Flexmonster initialization parameters:
const pivot = new Flexmonster({ // … customizeCell: customizeCellFunction });
Such methods include:
See the full list of Flexmonster methods.
There are two ways to subscribe to an event:
You can also unsubscribe from an event.
Define an event as the new Flexmonster() parameter and assign an event handler to it:
const pivot = new Flexmonster({ // … reportcomplete: onReportComplete });
See the full list of Flexmonster events.
Call the on() method using the reference to the Flexmonster instance:
pivot.on('reportcomplete', onReportComplete);
Check out the full list of Flexmonster events.
Use the off() method to unsubscribe from an event:
pivot.off('reportcomplete');
This will remove all handlers from the event. To remove a specific handler, pass its name as a second parameter to off()
:
pivot.off('reportcomplete', onReportComplete);
Note If a handler is specified as an anonymous function, you can remove it only by removing all handlers.