JSFiddle - React, Tailwind, and code Playground

Events

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="pivot-container">The component will appear here</div>

JavaScript

var pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  height: 340,
  report: {
    dataSource: {
      data: getData(),
      mapping: {
        Date: {
          type: "date string",
        },
      },
    },
  },
})

pivot.on("filterclose", function () {
  let filter = pivot.getFilter("Date")
  console.log(filter)
})

function getData() {
  return [
    {
      Date: "2025-04-04T22:52:00",
      Color: "green",
      M: "September",
      W: "Wed",
      country: "Canada",
      state: "Ontario",
      city: "Toronto",
      Price: 174,
      Quantity: 22,
    },
    {
      Date: "2025-05-04T22:52:00",
      Color: "red",
      M: "March",
      W: "Mon",
      Time: "1000",
      country: "USA",
      state: "California",
      city: "Los Angeles",
      Price: 30,
      Quantity: 19,
    },
  ]
}