Need a special offer?Find out if your project fits.
+

Clear cell formatting

Closed
Massimo asked on June 24, 2020

Hello,
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.
Regards

3 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 25, 2020

Hello,
 
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")
flexmonster.refresh()

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

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

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.
 
Regards,
Illia

Public
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?
Regards,
Massimo

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 7, 2020

Hello,
 
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.
 
Regards,
Illia

This question is now closed