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

setFormat() issues

Javier G. asked on August 7, 2019

I’m using Flexmonster v2.7.1. and I’m having some troubles using the setFormat() API call.
After calling the flexmonster.refresh() function, the grid is not updated with the formatting options introduced. I’m using this code in Javascript:
format = {
“maxDecimalPlaces “: “2”,
“nullValue” : “0”
As said, the report is not being refreshed (null values in the grid are still showing empty cells). However, if I then open up the format cells modal window, the 2 decimal places and 0 as null value are actually configured and shown there (and then if I just hit the apply button, the format is correctly applied on the grid cells).
Am I doing something wrong? 
Thanks in advance.

2 answers

Ian Sadovy Ian Sadovy Flexmonster August 7, 2019

Hello Javier,
Thank you for the question.
Please note, that default formatting also requires a name: "" in the format object.

var format = {
name: "",
maxDecimalPlaces: 2,
nullValue: "0"

Please refer to the following sample: https://jsfiddle.net/flexmonster/3y9odjhq/
Let us know if it works for you.

Javier G. August 8, 2019

Hello Ian,
Yes, adding the name:”” field worked perfectly.
Thank you!

Please login or Register to Submit Answer