🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all hot features!
Get Free Trial

Is there a way the Choose value option in Format Object can be defaulted to “All Values”

Answered
Tope asked on November 23, 2020

While setting the default “Format Object“, I was able to set the default properties on thousandSeparator, textAlign etc. I was wondering is there a way I can set the “Choose Value” property to be “All Values”. Right now I have it as name: “” (name set to empty string) 

3 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 25, 2020

Hello,
 
Thank you for reaching out to us.
 
In case we understand correctly, you would like to make the “All Values” item of the drop-down menu to be the default one. If so, we suggest overwriting the corresponding function responsible for creating the pop-up.
 
It is possible to make changes within the flexmonster.toolbar.js file itself:

1491 valuesDropDown.options[0] = new Option(Labels.choose_value, "empty");
1492 valuesDropDown.options[0].disabled = true;
1493 valuesDropDown.options[1] = new Option(Labels.all_values, "");
1491 valuesDropDown.options[0] = new Option(Labels.all_values, "");
...
1614 valuesDropDown.options[i + 2] = new Option(measures[i].name, measures[i].uniqueName);
1614 valuesDropDown.options[i + 1] = new Option(measures[i].name, measures[i].uniqueName);

Please note that this approach implies making these changes every time Flexmonster is updated. It is because the flexmonster.toolbar.js file will be replaced after the update as well.
 
To avoid this drawback, we suggest overwriting the function showFormatCellsDialog within the page itself. This function is responsible for rendering the corresponding pop-up. It can be accessed within the page using the following code snippet:

new Flexmonster({
  ...
  beforetoolbarcreated: customizeToolbar
});

function customizeToolbar(toolbar) {
  FlexmonsterToolbar.prototype.showFormatCellsDialog = function(measureName) {
    //place the overwritten function here
  }
}

 
You are welcome to see the JSFiddle we prepared to demonstrate this approach.
 
Please let us know if it works for you.
Feel free to contact us in case further questions arise.
 
Kind regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster December 2, 2020

Hello,
 
Our team is just wondering whether you had some time to test the suggested approach.
 
Please let us know if it works for you.
 
Kind regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster December 14, 2020

Hello,
 
We are reaching out to ask if you had the possibility to test this approach.
 
Please let us know if it works for your case.
Our team is looking forward to hearing your feedback.
 
Regards,
Illia

Please login or Register to Submit Answer