JSFiddle - React, Tailwind, and code Playground
Customizing the Toolbar
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>
JavaScript
let pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
height: 400,
toolbar: true,
beforetoolbarcreated: customizeToolbar,
report: {
dataSource: {
filename: "data/data.json",
},
},
})
function customizeToolbar(toolbar) {
let tabs = toolbar.getTabs()
toolbar.getTabs = function () {
//Remove dividers to save space
tabs = tabs.filter((tab) => !Object.hasOwn(tab, "divider"))
//Move right tabs to the left
tabs = tabs.map((tab) => {
if (tab.rightGroup) {
delete tab.rightGroup
}
return tab
})
return tabs
}
}