Results 1 to 3 of 3

Thread: Height of the Panel does not adjust (example code included)

  1. #1
    Sencha User brzi's Avatar
    Join Date
    Apr 2014
    Posts
    13

    Default Answered: Height of the Panel does not adjust (example code included)

    Hey there,

    I have created a small app with the new borderlayout. On the west I have a navigation tree and the center displays the according views after clicking on the tree items.

    In my example when I click on the "Morgenpost wow" item within the tree, a new view containing a form with some image is loaded. However the height of the panel is not correct. Its too small. You can see it on the attached screenshot (I'm using Chrome).

    However when I click on the "Morgenpost wow" item again, the view is loaded again and then the height is correct.

    I'm stuck with this problem at the moment, what am I doing wrong?

    -

    A panel.doLayout() after loading the new view did not help.

    The example add code can be downloaded here
    http://www.file-upload.net/download-...oblem.zip.html


    Thank you very much,
    chris
    Attached Images Attached Images

  2. Could be because it takes time for the image to load, when it first lays out it won't know the size. Try giving the image an explicit height.

    As a side-note, you're not using the view controllers as intended. Look at the ticket app to see how it uses a declarative style as opposed to control().

  3. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    Could be because it takes time for the image to load, when it first lays out it won't know the size. Try giving the image an explicit height.

    As a side-note, you're not using the view controllers as intended. Look at the ticket app to see how it uses a declarative style as opposed to control().
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #3
    Sencha User brzi's Avatar
    Join Date
    Apr 2014
    Posts
    13

    Default

    Wow, that was fast! Thank you very much evant!

    <s>Setting a fixed height works, thanks!</s>
    I also have to take a look at the example you've mentioned.


    Edit:
    Turns out the problem is still there, since its not always there I thought it was fixed.
    Anyone maybe knows some solution for this one?


    Edit 2:
    When I add "style: { display: 'block' } its is correctly computing the height.

    Code:
        {
                            xtype: 'image',
                            src: '/img/document_pdf.png',
                            id: 'pdfImage',
                            height: 128,
                            style: { display: 'block' },
                            flex: 1
                        },
    There is also a solution if you load a new image with a different size, it can be found here:
    http://stackoverflow.com/questions/6...s-extjs-layout


    Best,
    chris

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •