use html in caption

Answered
Paul Schlichter asked on August 2, 2018

In previous version we could use HTML in captions like using <br> to make long captions overflow.
It appears that we cannot do that in the latest version 2.6.
Is there another way to accomplish this?
thanks

13 answers

Public
Iryna Kulchytska Iryna Kulchytska Flexmonster August 2, 2018

Hi Paul,
 
You are right, starting from version 2.5.6 captions are escaped before displaying (certain characters, such as <, >", ' or / are replaced with the escape sequences). Thus, <br/> in captions will not act as HTML any more.
 
We would recommend you checking customizeCell function which can modify each cell in the table during rendering. Here are the examples of customizeCell function usage: https://www.flexmonster.com/examples/#!customize-cells
For example, you can add <br/> inside customizeCell function to make long captions overflow.
 
Please let us know if this approach works for you.
 
Kind regards,
Iryna

Public
Paul Schlichter August 2, 2018

Thanks Iryna,
Can you provide me with an example using a calculated field of unique name aggreorder with a caption of Aggressive<br>Reorder<br>(3 mths)?
Paul

Public
Tanya Gryshko Tanya Gryshko Flexmonster August 3, 2018

Hello, Paul,
Thanks for the quick update.
Please check the following JSFiddle sample: https://jsfiddle.net/flexmonster/8m29r63z/.
Hope it helps.
Regards,
Tanya

Public
Paul Schlichter August 3, 2018

Tanya,
That works great for the measures (data). Just can't figure out how to do the same with a row.
Thanks

Public
Tanya Gryshko Tanya Gryshko Flexmonster August 3, 2018

Paul,
Glad it works great for the measures. Have a look at the updated sample showing the same with a row: https://jsfiddle.net/flexmonster/8m29r63z/11/.
To learn more about cell customization options you're always welcome to turn to our documentation: customizeCell API call
Regards,
Tanya

Public
Paul Schlichter August 3, 2018

thanks Tanya,
this works for the cell which can be quite useful.
However was trying to change the column (header) caption for the row
Paul

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster August 6, 2018

Hello Paul,
Thank you for your feedback. Currently, the component does not support multiline in the filter cells.
However, could you please specify how critical that feature is for you? 
Waiting to hear from you.
Regards,
Dmytro

Public
Paul Schlichter August 6, 2018

Dmytro,
I have attached a screenshot of what I am looking for. It is in the caption for a "row" column rather than a filter.
Thanks

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster August 7, 2018

Hello Paul,
Thank you for providing us with the screenshot. The highlighted cell is a column header filter cell. Currently, the multiline is not supported for such type of cells. However, we are going to add an update which will allow using the new line symbol "\n" for the captions ETA Aug27. That should enable multiline support for the filter cells.
Regards,
Dmytro

Public
Paul Schlichter August 29, 2018

The latest release had this note:
Now the new line symbol("\n") is replaced with <br> for the header filter cells.
Could you provide a sample of how to use this?
Thanks
Paul

Public
Ian Sadovy Ian Sadovy Flexmonster August 30, 2018

Hello Paul,
 
Please check the following sample: https://jsfiddle.net/flexmonster/8m29r63z/22/ (see line 15).
Hope it helps.
 
Regards,
Ian

Public
Zoltan Sutto November 5, 2024

Hello,

Is there any option to use <br /> instead of customizeCell?

Regards,
Zoltan

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster November 7, 2024

Hello,

Thank you for contacting us.

Flexmonster does not support using the <br /> in the cells. If you have extended captions, you can implement multiline using the following CSS rules:

.fm-cell {
white-space: pre-wrap !important;
}

#fm-pivot-view .fm-grid-row {
max-height: 500px;
}

Please check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/Ljqu60gx/

You are welcome to contact us if other questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer