We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

break line int title grid

Closed
ELG PEDESTAIS asked on November 8, 2020

Tem como colocar quebra de linha no titulo?, vide anexo.

Attachments:
Screenshot_10.png

1 answer

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster November 9, 2020

Hi Douglas,
 
Thank you for posting your question.
 
Currently, Flexmonster does not provide built-in functionality to insert line breaks in the title.
 
Nevertheless, this can be achieved with custom CSS configurations – please see the quick sample we've prepared: https://jsfiddle.net/flexmonster/cpL7fvus/
 
In this sample, the following steps are taken :
 

  1. The grid title is initialized with an empty character (any string is possible here):
    options: {
    grid: {
    title: "\0"
    }
    }
  2. The inline-block value is specified for the display property of the title element through CSS to ensure the height of the title is adjusted properly, depending on the content:
    .fm-grid-title {
    display: inline-block;
    }

    Please note that in the code snippet above the class selector . is used instead of the id # – that is because in version 2.8.16 many IDs were changed to the corresponding class names due to particular accessibility improvements. More on this here.

  3. A custom aftergriddraw event handler is added to insert a line break when the grid is ready:
    pivot.on('aftergriddraw', (e) => {
    document.querySelector('span.fm-grid-title').innerHTML =
    'Lorem ipsum dolor sit amet, <br><span>consectetur adipiscing elit.</span>'
    })

Please let us know if this helps.
 
Best regards,
Mykhailo

This question is now closed