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

Align String data type columns to right

Resolved
Ravi Kumar asked on January 20, 2021

Hi Flexmonster Team,

I tried to align the string data type column to right side using formats but it is not working.
I'm providing the data and the formats i used please check and provide any solution.
I need to align the "Revenue" string column data to right side. Please suggest.
Data:
[
{"Job":"India","Revenue":"1322.789"},
{"Job":"Russia","Revenue":"901.081"},
{"Job":"Australia","Revenue":"792.113"}
]
Formats Array: 
[
{name: "Revenue", textAlign: "right"}
]
 
Regards,
Ravi Kumar

2 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster January 21, 2021

Hello,
 
Thank you for reaching out to us.
We want to explain that the specific field is linked with its formatting object using the format property:

slice: {
  {
    uniqueName: "Revenue",
    format: "formattingName"
  }],
  ...
}

 
The same name should be specified as a value of the Format Object:

[{
    "name": "formattingName",
    "textAlign": "right"
}]

 
You are welcome to see the JSFiddle demonstrating this approach: https://jsfiddle.net/flexmonster/49172hok/.
 
More information about the ways to define formatting can be found in our documentation.
 
Please let us know if it helps.
If the desired functionality differs from the described one, or the provided approach does not work for your configuration, please modify the provided JSFiddle to demonstrate the issue. This will allow us to find a suitable solution for your specific case.
 
Regards,
Illia

Public
Ravi Kumar January 21, 2021

Hi Illia,
It suits our requirement.
I didn't added format name in slice property instead provided direct "Revenue" to the name in formats.
It works fine.
 
Regards,
Ravi Kumar

Please login or Register to Submit Answer