1. #1
    Sencha User
    Join Date
    May 2011
    Location
    France
    Posts
    3
    Vote Rating
    0
    Pitivier is on a distinguished road

      0  

    Default autoHeight feature

    autoHeight feature


    Hello,

    I'm trying to migrate to extJS 4 an application writen with extJS 3.3 and I can't find how to replace the autoHeight config option of the Panel. What is the correct way to automaticaly resize a Panel with extJS 4 when the browser is resized ?

    thanks a lot.

  2. #2
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    have you tried putting layout: 'fit' on the container of the panel?

  3. #3
    Sencha User
    Join Date
    May 2011
    Location
    France
    Posts
    3
    Vote Rating
    0
    Pitivier is on a distinguished road

      0  

    Default


    Yes I have tried this layout but it doesn't work like I want.

    Here is my code :

    Code:
        var previewPanel = new Ext.Panel({
            title: 'Aperçu',
            id: 'preview-panel',
            renderTo: 'apercu',
            width: '100%',
            layout: {
                type: 'fit'
            },
            //height: 500,
            autoHeight: true,
            collapsible: false,
            items: [{
                xtype: 'box',
                id: 'div-cadre-apercu',
                autoEl: {
                    id: 'apercu',
                    tag:"img",
                    src: "apercu" + action + "?timestamp=" + (new Date().getTime()),
                    border: "0",
                    height: "100%"
                }
            }]
        });
    It loads an image in a panel. The problem is I dont know the size of the image. With ExtJS 3.3 the autoHeight config option is perfect. The panel adjust automaticaly its size to the image. With ExtJS 4, this option is gone and I don't know how to do the same thing. I have the same problem with A GridPanel wich I want to be automatically resized when I resize the browser window.

  4. #4
    Ext JS Premium Member
    Join Date
    Apr 2011
    Location
    Dallas, TX
    Posts
    204
    Vote Rating
    1
    Justin Noel is on a distinguished road

      0  

    Default


    Perhaps the align setting will help? I'm not sure, but it's worth a try.

    Code:
    	layout: {
            type: 'fit',
            align: 'stretch'
        }

  5. #5
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    Quote Originally Posted by Justin Noel View Post
    Perhaps the align setting will help? I'm not sure, but it's worth a try.

    Code:
    	layout: {
            type: 'fit',
            align: 'stretch'
        }
    I think the align: 'stretch' option only works with box layouts. Which is an interesting choice - could you do as Justin suggests, but make the layout 'hbox', and then flex: 1 on the child panel config?

    stevil

  6. #6
    Sencha User
    Join Date
    May 2011
    Location
    France
    Posts
    3
    Vote Rating
    0
    Pitivier is on a distinguished road

      0  

    Default


    It doesn't work. Only the title bar of the panel is visible.

  7. #7
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    I do know one thing, and that seems true in 4.0 - it's definitely easier to size child to parent than parent to child. I'm going to have to think about this more, because my inclination would be to say, "detect the rendering of the child, then size the Panel on your own", but that's unclean, and may indicate there's something I'm not considering in the framework.

    stevil

  8. #8
    Ext JS Premium Member cmeans's Avatar
    Join Date
    Jun 2010
    Location
    Chicago, IL USA
    Posts
    99
    Vote Rating
    4
    cmeans is on a distinguished road

      0  

    Default


    I'd really like to get these properties/features back too. I have a window who's size has to be able to expand/contract depending upon whether the user expands/contracts a panel. Obviously, there are programmatic ways to accomplish this, but the autoHeight feature took care of this for me automatically, so upgrading to ExtJS4 has become much more problematic.

  9. #9
    Sencha User
    Join Date
    Feb 2008
    Location
    HCM, VietNam
    Posts
    23
    Vote Rating
    0
    spidermanit is on a distinguished road

      0  

    Default


    Hi All, so what is the final solution for did? I got the same problem. Any tips please.

  10. #10
    Sencha User
    Join Date
    Feb 2008
    Location
    HCM, VietNam
    Posts
    23
    Vote Rating
    0
    spidermanit is on a distinguished road

      0  

    Default


    Hi All, so what is the final solution? I got the same problem, did you fix it Pitivier?

Similar Threads

  1. window autoHeight
    By mjlecomte in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 31 Aug 2008, 7:45 AM
  2. TreeLoader: new feature request and patch to add this feature
    By osantana in forum Community Discussion
    Replies: 3
    Last Post: 12 Jun 2008, 9:42 AM
  3. Accordion Autoheight
    By wekkaw in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 1 Feb 2008, 7:08 AM
  4. re-call autoHeight feature in tabs?
    By ultrus in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 8 Jan 2008, 12:19 PM
  5. Tab autoHeight problem
    By hawk_turner in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 26 Dec 2007, 7:21 AM

Thread Participants: 7

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar