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

Dynamically Changing Measure Labels in the Field List Without updateData()

Answered
Jean Teran asked on February 11, 2025

Hello Flexmonster Support Team,

I hope you're doing well.

I would like to know if there is a way to dynamically change the labels (captions) of the [measures] in the field listwithout calling updateData(). The goal is to update the captions when selecting different date ranges without triggering a report re-render.

Is there any built-in method or workaround to achieve this?

Also we are working with the Flexmonster DataServer, any suggestion for this other also will work.

Thank you for your support!

3 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster February 13, 2025

Hello, Jean!

Thank you for reaching out to us.

Just to clarify, do you need to change the measure captions after selecting a new date range while the Field List is open without closing it? Understanding this would greatly help us to give more accurate recommendations.

Looking forward to hearing from you.

Best Regards,
Maksym

Public
Jean Teran February 13, 2025

Hi, Maksym:

Exactly, when an user changes date ranges they hoping to see the new labels to avoid confusion, when a report has not data it works properly but when data exists in datasource the flexmonster tries to reordering or analyze the change. The main idea is change this labels without triggering any event until user hits the Apply button.

Another question,  exists some way to getting the Field List changes while it is opened and before hitting the Apply button?

Public
Maksym Diachenko Maksym Diachenko Flexmonster February 14, 2025

Hello, Jean!

Thank you for the clarification.

Please note that the Fields List labels cannot be changed without reloading the report. To synchronize the external filter values with field labels, you should prioritize maintaining the current field labels or reloading the report to reflect the updated external filter values accordingly. From our perspective, there are the following ways it can be done:

  • The date range selection should be disabled when the Fields List is open. For this, we suggest using fieldslistopen and fieldslistclose events to track whether it is opened or closed.
  • The current workflow is kept, where the report is re-rendered after changing the date range. The only possible improvement for this case could be programmatically reopening the Fields List after data reload using the openFieldsList API call after the reportcomplete event.

Retrieving the changes made in the Field List before clicking the "Apply" can be queried from DOM with the querySelectorAll: https://jsfiddle.net/flexmonster/9s6b7jan/

Please let us know if the described workarounds would work for you.

Best Regards,
Maksym

Please login or Register to Submit Answer