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="pivot-container"></div>
CSS
.highlight {
background: #fdfd96 !important;
}
JavaScript
var pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
global: {
localization: {
grid: {
blankMember: "test"
}
}
},
report: {
"dataSource": {
"type": "json",
"data": [{
"TestNumber": {
"type": "number"
},
"TestString": {
"type": "string"
}
},
{
"TestNumber": null,
"TestString": ""
},
{
"TestNumber": 2,
},
{
"TestNumber": 2,
"TestString": "TestString1"
}
]
},
"slice": {
"rows": [{
"uniqueName": "TestString"
}],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "TestNumber",
"aggregation": "sum"
}]
},
"options": {
"grid": {
"type": "flat"
}
},
"formats": [{
"name": "",
"nullValue": "test"
}],
}
});
pivot.customizeCell(customizeCellFunction);
function customizeCellFunction(cell, data) {
if (data && data.label == "test") {
console.log(data);
cell.addClass("highlight");
}
}