We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

How to remove/hide empty cells and prevent selection

Answered
Yousif Ahmed asked on February 25, 2019

Hi,
I am trying to prevent flexmonster from rendering empty cells in the space around the grid, and am running into some problems. It seems there used to be an option called 'fitGridLines' in earlier versions, but it is no longer available and I cannot find any alternatives/workarounds in the release notes or migration guides.
 
I found a forum question with an example of how to hide empty cells using the css below, however there is still lots of unnecessary white space and the empty cells are still selectable. Is there a better way to do this? Or alternatively, is there a way of sizing the rows and columns dynamically to fill the entire container?...
 
#fm-pivot-view .fm-grid-layout .fm-empty
{
border-color: transparent !important;
}
#fm-pivot-view .fm-grid-layout #fm-data-sheet
{
border-top-color: transparent !important;
}
Also, when using the above css, while the empty cells have no border they are still there and the user is still able to select them. I can see that there used to be an options parameter called 'selectEmptyCells', but again it looks like this has gone. I have tried to hook into the cellclick event to stop selection if the cell is empty, but I cannot access to the JS event object in the event handler so there seems to be no way of stopping the event from propagating. Is there another way of achieving this?
 
Many thanks,
 
Yousif

2 answers

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster February 26, 2019

Hello Yousif,
Thank you for posting your question here.
Yes, you are totally right, the CSS approach does not remove the empty cells from the grid and also does not prevent them from selecting. 
In such case, we recommend creating Flexmonster Pivot instance with the appropriate width so there was no space for empty cells.
That is the only option for now.
Please let us know in case of any other question.
Regards,
Dmytro

Public
Yousif Ahmed March 1, 2019

OK thank you for your advice 🙂

Please login or Register to Submit Answer