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

How to update a specific cell value in the Report Data

Answered
Amogh Arsekar asked on March 4, 2025

I have a method that uses jquery to modify the data in a cell directly. The problem is the data is refreshed by customizeCellFunction. The solution would be to modify the actual report data directly instead of just modifying the DOM. I want to know if modifying the cell data directly in the Report json is possible.

3 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster March 5, 2025

Hello, Amogh!

Thank you for reaching out to us.
Can you provide more details on your use case? Understanding what you are trying to achieve will help us suggest the best solution.
Looking forward to hearing from you.

Best Regards,
Maksym

Public
Amogh Arsekar March 6, 2025

Hello,

We have a remarks column where we allow users to enter any comments they need to for each line item (row).

Here you can see the first row has a remark saved already. When I click on the + icon it allows me to enter a remark :

To let the cell know that a comment is present and for it to change the icon/ method that is triggered on click of it, I am using customizeCellFunction. And checking for certain values in the row data. Problem is, these values are getting added to the cell using JQuery and Flexmonster has no idea about the updation. So when customizeCellFunction gets triggered again, the cell where a remark was just added reverts back to it's original state. We need a away to somehow update the data that is given as input to Flexmonster to fix this problem

Public
Maksym Diachenko Maksym Diachenko Flexmonster March 7, 2025

Hello, Amogh!

Thank you for sharing more details about your use case.

Updating the data within the report is indeed necessary to ensure that Flexmonster reflects the changes in the "Remarks" column. This can be done using the updateData method, which can update the data in runtime without changing other report settings. To add a single remark per update, we recommend using the partial update feature; however, note that it is only supported for JSON data sources. You can find more information and the example of partial data update in our documentation: https://www.flexmonster.com/api/updatedata/#example-4

Keep in mind that these changes only apply to the current visualization. You will need to implement custom logic to save the comments so that they persist after the page is reloaded or opened by other users.

Also, modifying cells directly via the DOM using jQuery is not recommended, as Flexmonster does not track those changes. This can lead to inconsistencies when the grid refreshes or re-renders.

Please let us know if you need any further assistance.

Best Regards,
Maksym

Please login or Register to Submit Answer