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>
<h4>
Enable Validation and try to add the calculated value "Sum(ize)" instead of "Sum(Size)". You should see a warning message when trying to apply.
</h4>
<h4>
Disable Validation and try to add the calculated value "Sum(ize)" instead of "Sum(Size)". No warning message will appear when trying to apply.
</h4>
<button onclick="validateFormulas()">Enable Validation</button>
<button onclick="notValidateFormulas()">Disable Validation</button>
<div id="pivot-container"></div>

JavaScript

function validateFormulas(){
   var options = pivot.getOptions();
   options.validateFormulas = true;
   pivot.setOptions(options);
   pivot.refresh();
}

function notValidateFormulas(){
   var options = pivot.getOptions();
   options.validateFormulas = false;
   pivot.setOptions(options);
   pivot.refresh();
}

var pivot = new Flexmonster({
  container: "#pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: {
    dataSource: {
      dataSourceType: "json",
      data: getData()
    },
    slice: {
        rows: [
            {
                "uniqueName": "Country"
            },
            {
                "uniqueName": "Category"
            },
            {
                "uniqueName": "[Measures]"
            }
        ],
        columns: [
            {
                "uniqueName": "Color"
            }
        ],
        measures: [
            {
                "uniqueName": "Price",
                "aggregation": "sum"
            },
            {
                "uniqueName": "Quantity",
                "aggregation": "sum"
            },
            {
                "uniqueName": "Formula #1",
                "formula": "sum(\"rice\")",
                "caption": "Sum(rice)"
            }
        ]
    },
    options: {
        "validateFormulas": false
    },
    conditions: [
        {
            "formula": "isNaN(#value)",
            "measure": "Formula #1",
            "format": {
                "backgroundColor": "#FF9800",
                "color": "#FFFFFF",
                "fontFamily": "Arial",
                "fontSize": "12px"
            }
        }
    ]
  },
  width: "100%",
  height: 370
});

function getData() {
  return [{
    "Category": "Accessories",
    "Size": "262 oz",
    "Color": "red",
    "Destination": "Australia",
    "Business Type": "Specialty Bike Shop",
    "Country": "Australia",
    "Price": 174,
    "Quantity": 225,
    "Discount": 23
  }, {
    "Category":...