☝️Small business or a startup? See if you qualify for our special offer.
+

Unable to Get Row Data on Cell Click in Flexmonster

Answered
Fenil Patel asked on September 6, 2025

Hello Flexmonster Team,

I am trying to get the row data of a cell when it is clicked in my pivot table. Currently, I am using the cellclick event, but I am unable to retrieve the full data of the corresponding row—I only get limited cell information (like value, type, etc.).

Steps to Reproduce:

  1. Initialize a Flexmonster pivot table with a dataset.

  2. Add a cellclick event handler:

 

window.flexmonster.on("cellclick", function(cell) {
console.log(cell);
});

  1. Click on any cell in the pivot table.

Expected Behavior:
I should be able to retrieve the entire row’s data corresponding to the clicked cell.

Actual Behavior:
Currently, only partial information is available; there seems to be no direct method to get the complete row data from the cell click.

Could you please advise the correct approach to get the full row data when a cell is clicked?

 

Thank you,
Patel Fenil

3 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster September 10, 2025

Hello,

Thank you for writing to us.

The cellclick event is designed to provide information specific to the clicked cell rather than the whole row. Could you please share more information about your use case and what you would like to achieve by getting data from an entire row? Understanding the whole use case will help us suggest the most suitable approach.

Looking forward to hearing from you.

Best Regards,
Maksym

Public
Fenil Patel September 11, 2025

Hello Maksym,

Thank you for your response. Let me explain my use case in more detail.

In my pivot reports, one of the columns contains an emp_code. When a user clicks on any cell of a row, I need to identify the corresponding emp_code from that row so that I can display additional information (for example, the employee’s image and related details).

The challenge is that the emp_code column is not fixed – it can vary depending on the report configuration. Because of this, I cannot rely on column positions. Instead, I need a way to access the full row’s data from the cellclick event, so I can always retrieve the emp_code regardless of where it appears.

Could you please advise on the best approach to achieve this within Flexmonster?

 

Best Regards,
Patel Fenil

Public
Maksym Diachenko Maksym Diachenko Flexmonster September 12, 2025

Hello,

Thank you for sharing these valuable details.

If you only need to fetch a single value, you can use an alternative approach, which revolves around creating an ID field. You can define the "id" type for emp_code to identify records in the dataset. This identifier will be passed to the CellDataObject used in the cellclick event as a recordId property. This way, you could retieve the emp_code on clicking cell instead of retrieving the entire row data: https://jsfiddle.net/flexmonster/4tropdw3/

Setting the type: "id" for the field removes it from the Field List selection, and it cannot be shown on the grid. However, if the emp_code should be displayed on the grid, you can create two fields from the emp_code, where one instance would be an identifier and the other would have the string type and be visible on the grid.

Also, please note that creating ID fields is only supported for JSON and CSV data sources.

Hope you will find our answer helpful.

Best regards,
Maksym

Please login or Register to Submit Answer