Expand/collapse a specific node on the grid
Configuring the slice
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<button onclick="expandCell('columns', '[''Accessories'', ''Canada'']')">Expand Canada</button>
<div id="pivot-container"></div>
JavaScript
let pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
filename: "data/data.json"
},
slice: {
columns: [
{
uniqueName: "Category"
},
{
uniqueName: "Country",
filter: {
members: ["Canada", "France", "Germany"]
}
},
{
uniqueName: "Color"
}
],
rows: [
{
uniqueName: "[Measures]"
}
],
measures: [
{
uniqueName: "Price"
}
],
/*
expands: {
columns: [
{
tuple: ["category.[accessories][Canada]"]
}
]
}
*/
}
}
});
function expandCell(axis, tuple) {
flexmonster.expandCell(axis, tuple);
}
function collapseCell(axis, tuple) {
flexmonster.collapseCell(axis, tuple);
}