Pivot scroll

Pivot scroll after update data with custom dataSource

by inunziante

HTML

<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<button onclick="updateData()">Update Data</button>
<div id="pivot-container"></div>

JavaScript

const pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  customizeCell: customizeCellFunction,
  width: "100%",
  height: 300,
  report: {
    dataSource: {
      type: "api",
      url: "https://olap.flexmonster.com:9500",
      index: "fm-product-sales",
    },
    formats: [{
      name: "-93h3v6ei72q00",
      currencySymbol: "€",
      decimalPlaces: 15
    }],
    slice: {
      drills: {
        "drillAll": true
      },
      expands: {
        "expandAll": true
      },
      rows: [{
        uniqueName: "Category"
      }, {
        uniqueName: "Color"
      }, {
        uniqueName: "[Measures]"
      }],
      columns: [{
        uniqueName: "Size"
      }],
      measures: [{
        uniqueName: "Price",
        format: "-93h3v6ei72q00"
      }]
    }
  }
});


function updateData() {
  flexmonster.updateData({
    type: "api",
    url: "https://olap.flexmonster.com:9500",
    index: "fm-product-sales",
  });
}

function customizeCellFunction(cell, data) {
  if (data.label && data.label.includes(" oz")) {
    cell.text = cell.text.replace(" oz", " oz very long...........ggggggggggggg....")
  }
}