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="blocker"></div>
<button onclick="alert('clicked')">
Clickable button
</button>
<span>Try to open any pop-up window</span>
<div id="pivot-container"></div>
CSS
#blocker {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 11;
background: white;
opacity: 0.8;
display: none;
}
#pivot-container {
margin: 20px;
margin-bottom: 0px;
border: 2px solid yellow;
}
button {
margin-left: 20px;
margin-right: 20px;
margin-top: 20px;
}
span {
text-transform: uppercase;
font-weight: bold;
padding: 10px 10px;
font-size: 14px;
}
JavaScript
new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "90%",
height: 300,
toolbar: true,
report: {
dataSource: {
filename: "data/sales.csv"
},
slice: {
columns: [{
uniqueName: "Month"
}, {
uniqueName: "[Measures]"
}],
rows: [{
uniqueName: "Category",
filter: {
members: [
"category.[condiments].[bbq sauce]",
"category.[breakfast cereals].[corn flakes]",
"category.[confectionery]",
"category.[bakery].[chocolate biscuits]",
"category.[fruit preserves].[apple jam]",
"category.[bakery].[apple cake]",
"category.[soups].[tomato soup]"
]
}
}],
measures: [{
"uniqueName": "Revenue",
"aggregation": "sum",
"format": "2sfou03a"
}]
},
conditions: [{
formula: "#value < 2500",
measure: "Revenue",
format: {
backgroundColor: "#df3800",
color: "#FFFFFF"
},
isTotal: false
}, {
formula: "#value > 20000",
measure: "Revenue",
format: {
backgroundColor: "#00A45A",
color: "#FFFFFF"
},
isTotal: false
}],
formats: [{
name: "2sfou03a",
thousandsSeparator: ",",
decimalSeparator: ".",
decimalPlaces: 2,
currencySymbol: "$",
currencySymbolAlign: "left",
nullValue: "",
textAlign: "right",
isPercent: false
}]
}
});
var blocker = document.getElementById('blocker');
var toolbarObserver = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.removedNodes.length == 0)
blocker.style.display = 'block';
else blocker.style.display = 'none';
});
});
var gridObserver = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.target ==...