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="pivotContainerAdmin"></div>
<div id="pivotContainerA"></div>
<div id="pivotContainerB"></div>
CSS
#pivotContainerAdmin, #pivotContainerA {
margin-bottom: 20px;
}
JavaScript
var pivotAdmin = new Flexmonster({
container: "pivotContainerAdmin",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: false,
height: 250,
report: {
dataSource: {
data: getData(),
mapping: {
Type: {},
Email: {},
Name: {},
Phone: {}
}
},
"slice": {
"rows": [
{ "uniqueName": "Type" },
{ "uniqueName": "Email" },
{ "uniqueName": "Name" },
{ "uniqueName": "Phone" }
]
},
"options": {
"grid": {
"title": "Admin View",
"type": "flat",
"showTotals": "off",
"showGrandTotals": "off"
}
}
}
});
var pivotA = new Flexmonster({
container: "pivotContainerA",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: false,
height: 250,
report: {
dataSource: {
data: getData(),
mapping: {
Type: { filters: false },
Email: {},
Name: {},
Phone: {}
}
},
"slice": {
"rows": [{
"uniqueName": "Type",
"filter": { "members": [ "type.[a]" ] }
},
{ "uniqueName": "Email" },
{ "uniqueName": "Name" },
{ "uniqueName": "Phone" }
]
},
"options": {
"grid": {
"title": "User A View",
"type": "flat",
"showTotals": "off",
"showGrandTotals": "off"
}
}
}
});
var pivotB = new Flexmonster({
container: "pivotContainerB",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: false,
height: 250,
report: {
dataSource: {
data: getData(),
mapping: {
Type: { filters: false },
Email: {},
Name: {},
Phone: {}
}
},
"slice": {
"rows": [{
"uniqueName": "Type",
"filter": { "members": [ "type.[b]" ] }
},
{ "uniqueName": "Email" },
{ "uniqueName": "Name" },
{ "uniqueName": "Phone" }
]
},
"options": {
"grid":...