Hi Team!
Is there any/best way to control the no of rows and columns as per our need? We are getting a lot of blank rows and columns irrespective of the data, which it contains. The display of the rows and columns has to be dependent on the data, the table is displaying.
Hello,
Thank you for reaching out to us.
Hiding empty cells on the grid:
A quick solution is to hide empty cells on the grid via CSS, for example:
#fm-pivot-view .fm-grid-layout div.fm-cell.fm-empty {
border-right: 1px solid transparent;
border-bottom: 1px solid transparent;
}
Here is a JSFiddle for illustration: https://jsfiddle.net/flexmonster/2jswzt91/.
Also, it is possible to hide the sheet headers and remove cell borders altogether: https://jsfiddle.net/flexmonster/m44besj9/.
A way to adjust Flexmonster's dimensions to show only the filled part of the grid:
Our team recommends the following approach:
width
and height
parameters with the following value: 100%
. It allows resizing the component according to the wrapper's size.400×300px
.
We have prepared a sample that demonstrates the described approach: https://jsfiddle.net/flexmonster/bae4x237/.
Below are some additional details on the provided solution:
<div id="wrapper">
<div id="pivotContainer"></div>
</div>
const MIN_RECOMMENDED_WIDTH = 400;
const MIN_RECOMMENDED_HEIGHT = 300;
const MAX_CUSTOM_WIDTH = 800;
const MAX_CUSTOM_HEIGHT = 800;
flexmonster.on("reportcomplete", () => {
flexmonster.off("reportcomplete");
...
});
flexmonster.on("aftergriddraw", () => {...});
Please let us know if this helps.
Looking forward to your response.
Kind regards,
Vera