Get Free Trial

Grid Icon click handler

Tanushree asked on February 2, 2021

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:

  1. Attaching an appropriate listener (cellclick only works when clicked on any cell/header but doesn’t handle grid icon click events)
  2. Taking custom action once Grid icon is clicked – After showGrid() I need to invoke refresh() api.

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.

3 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster February 3, 2021

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:
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 => == "fm-tab-grid")[0];
    gridTab.handler = () => {
    return tabs;

See the JSFiddle we have prepared for the demonstration:
Please let us know if it helps.
Our team is looking forward to hearing from you.

Tanushree February 9, 2021

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?

Illia Yatsyshyn Illia Yatsyshyn Flexmonster February 11, 2021

We want to kindly draw your attention to the mentioned JSFiddle that demonstrates the recommended way to specify this handler:
If it does not help, please modify the JSFiddle to demonstrate the issue.

Please login or Register to Submit Answer