Get Free Trial

Clear cell formatting

Massimo asked on June 24, 2020

I’m wondering whether I can clear (reset to default) the formatting applied to all or a specific value. It seems that the only way is to manually change all properties to their default field by field.

3 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 25, 2020

Thank you for reaching out to us.
Formatting of the specific measure can be reset through calling the setFormat API call with an empty Format Object specified as its first parameter:

flexmonster.setFormat({}, "Measure Name")

Number formatting of all measures can be cleared at once using the following construction:

for (let measure of flexmonster.getMeasures())
    flexmonster.setFormat({}, measure.uniqueName)

It relies on the getMeasures API call. Such method returns an array of all measures chosen to be displayed on the grid. Next, their formatting is cleared in the loop.
You are welcome to check out an example demonstrating the described approach.
Please let us know if it helps.
We are looking forward to hearing from you.

Massimo July 6, 2020

Hello Illia,
Thank you for your answer.
I really appreciate that Flexmonster exposes an API for clearing cell formats but it seems to me a basic functionality that should be supported by the UI out-of-the-box.
Currently, in fact, there’s no way for an end-user to know for which measure formattings have been changed and to reset/clear them to their default values.  
So I know that I can customize your screens, but is there any possibility to have such a function provided by the pivot itself?

Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 7, 2020

Thank you for your feedback and for sharing your ideas with us.
Our team has added your request to our client wish-list.
We will notify you if something is changed on this point.
As for now, we suggest complementing the flexmonster.toolbar.js file in the way the desired controls are added to the number formatting pop-up.
We hope it works for your case.
Please let us know in case of further questions on this point.

Please login or Register to Submit Answer