JSFiddle - React, Tailwind, and code Playground

by Flexmonster Pivot Table

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"></div>

JavaScript

let pivot = new Flexmonster({
  container: "pivotContainer",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: {
    dataSource: {
      filename: "data/data.csv"
    }
  }
});

flexmonster.on("cellclick", cellClickHandler); //subscription to the event

function cellClickHandler(cell) {
  if (!checkImage()) return; //check if image exists. If not, return from the function
  alert("Handler executed"); //handler itself
}

function checkImage() { //mock function
  return Math.random() > 0.5;
}