[Data Grid Reactive] Line breaks of header on specific position
Question
Forge component by OutSystems R&D

Hello,
I have been trying to break line of the header text by following this discussion.
https://www.outsystems.com/forums/discussion/71303/how-to-wordwrap-column-header-and-set-header-height-on-grid-load/

What our client's requirement is to break the line at the specific position.
For example: If the header text is "This header is so big that needs to wrap", then after breaking to specific position the
header will be:

"This header
is so big
that needs
to wrap"

I have tried with <br>, "\n" etc and also set the isContentHtml to true.
I have also checked the grapecity discussion and tried to implemet.
https://www.grapecity.com/forums/wijmo/iscontenthtml-not-working-

But I could not break the text to specific position.

HeaderSetting:


Script:


Is it possible to break the header text to specific position?

Thanks!

Solution

Hello @Blue Pearl ,

First of all, we can see that you've already been trying to use whatever has been suggested in another cases. 

In order to achieve your requirement, there is a solution but it has a cost regarding performance, because you will have to use the flexgrid event call formatItems, this runs whenever there is a change in the grid, a scroll, a click... and it runs for every visible cell:

You can try this, add <br/> where you need to break the column, but be aware of any performance loss:

In attachment, you can find a sample OML with this implementation.

Please keep in mind that this hasn't been tested for all possible use cases or that it cover all of your requirements, so we cannot assure that it will work for all use cases.

Please let us know if this helps.

Bruno Martinho

HeaderHeight.oml

Thanks Bruno!
This helps what I wanted to achieve.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.