Hello Team,
Is there a way we can handle the grid icon click event?
I currently need to invoke refresh() after showGrid() api call when Grid icon is clicked.
The challenges I'm facing are:
It's even tricky in our case as we have multiple Flex Monster grids on same screen for multiple reports and need to find a way to listen to grid click events in appropriate FM container and take action.
Thanks,
Tanushree
Hello,
Thank you for contacting us.
If we understand correctly, you require this functionality to remove the blank space appearing under the grid as described within the following thread: https://www.flexmonster.com/question/empty-space-at-the-bottom-when-grid-icon-clicked/.
In this case, we suggest checking out the mentioned thread to learn the possible reason for this behavior.
If the workaround with refresh
API call is still needed, please see the explanation below.
You can overwrite the default handler of the "Grid" button in order to add custom functionality.
For example:
pivot.on("beforetoolbarcreated", (toolbar) => { let tabs = toolbar.getTabs(); toolbar.getTabs = () => { let gridTab = tabs.filter(tab => tab.id == "fm-tab-grid")[0]; gridTab.handler = () => { pivot.showGrid(); pivot.refresh(); } return tabs; } });
See the JSFiddle we have prepared for the demonstration: https://jsfiddle.net/flexmonster/63h91q70/.
Please let us know if it helps.
Our team is looking forward to hearing from you.
Regards,
Illia
Thanks Illia for your response.
I did try adding a custom handler but this didn't work.
In fact, after adding custom handler for Grid click, showGrid() api is not called at all now and therefore refresh() doesn't get called as well.
Is there a better way to handle Flex Monster to re-size correctly through javascript?
Thanks,
Tanushree
Hello,
We want to kindly draw your attention to the mentioned JSFiddle that demonstrates the recommended way to specify this handler: https://jsfiddle.net/flexmonster/63h91q70/.
If it does not help, please modify the JSFiddle to demonstrate the issue.
Regards,
Illia