reportchange

Events

HTML

<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<div id="pivotContainer">The component will appear here</div>

JavaScript

let pivot = new Flexmonster({
  container: "pivotContainer",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
   report: {
    "dataSource": {
      "type": "json",
      "filename": "data/retail-data.json"
    },
    "slice": {
      "rows": [{
        "uniqueName": "Country"
      }],
      "columns": [{
        "uniqueName": "[Measures]"
      }],
      "measures": [{
        "uniqueName": "Price",
        "aggregation": "sum"
      }]
    },
    "options": {
      "viewType": "charts"
    },
    "localization": {
      "grid": {
        "blankMember": "N/A",
        "dateInvalidCaption": "N/A"
      }
    },
    "version": "2.9.57",
    "creationDate": "2023-08-14T17:37:10.098Z"
  }
});

/* To see the alert you should change the report. 
   For example, apply any sorting or filtering.   */
flexmonster.on('reportchange', function () {
  alert('Report changed!');
  console.log('report change')
});