pe:codeMirror set height?

Community Driven Extensions Project
Post Reply
vished
Posts: 479
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
PF 8.0

Melloware
Posts: 3717
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 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

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

11 Mar 2020, 00:53

thank you, that´s working
PF 8.0

Zardo
Posts: 56
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: 3717
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 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Zardo
Posts: 56
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: 56
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: 3717
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 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests