pe:codeMirror set height?

Community Driven Extensions Project
Post Reply
vished
Posts: 420
Joined: 02 Feb 2014, 17:38

09 Mar 2020, 19:43

Hi all,

How can I set the height in pe:codeMirror ?
I´ve tried: style="height: 100px !important;" but it seems it´s not working.
Any idea?

Thank you

Melloware
Posts: 1670
Joined: 22 Apr 2013, 15:48

09 Mar 2020, 19:48

Unfortunately you can't do it inline you have to do with CSS loaded on the page.

Code: Select all

<style type="text/css">

.CodeMirror {
    height: 200px;
}
</style>
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0 / PF Extensions 8.0

vished
Posts: 420
Joined: 02 Feb 2014, 17:38

11 Mar 2020, 00:53

thank you, that´s working

Zardo
Posts: 49
Joined: 29 Jul 2015, 15:41

24 Mar 2020, 09:02

and if I would like to set the height to 100%?

Code: Select all

            <style type="text/css">
                .CodeMirror {
                    height: 100%;
                }
            </style>
doesn't work

Melloware
Posts: 1670
Joined: 22 Apr 2013, 15:48

24 Mar 2020, 13:31

Its probably 100% of the container object you have the codemirror in?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0 / PF Extensions 8.0

Zardo
Posts: 49
Joined: 29 Jul 2015, 15:41

24 Mar 2020, 14:34

I should had explain better: the size of the parent (container) is right. The size of codemirror seems to be 100%, but the scrollbars are not shown.

Zardo
Posts: 49
Joined: 29 Jul 2015, 15:41

24 Mar 2020, 14:40

Update: if I call

Code: Select all

window.dispatchEvent(new Event('resize'));
the scrollbars appear

Melloware
Posts: 1670
Joined: 22 Apr 2013, 15:48

24 Mar 2020, 14:56

Got it that might be an issue with the CodeMirror itself. You might have to call that to get it to realize it needs to render scrollbars.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0 / PF Extensions 8.0

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest