1. #11
    Sencha User
    Join Date
    Jul 2011
    Posts
    13
    Vote Rating
    1
    silan is on a distinguished road

      0  

    Default


    With 4.0.2a, autoHeight only works on text content, not image. I just checked EXT JS release notes (up to 4.0.6) and didn't find anything about this. Does this mean for now with 4.0 we have to provide a fixed height for a panel to contain dynamically loaded images?

  2. #12
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    27
    Vote Rating
    1
    Stroker is on a distinguished road

      0  

    Default


    If you have a panel that you want to get resized to fit the image you could setup a listener to the load event of the image.

    PHP Code:
    new Ext.Panel({
          
    title'Panel'
            
    items: [{
                
    xtype'box',
                
    autoEl: {
                    
    tag:"img"
                    
    src'http://www.imagegossips.com/wp-content/uploads/2011/01/rupi-8744-nature-beauty.jpg'
                
    }, 
                
    listeners: {
                   
    render: function(box) {
                      
    box.el.on('load', function(ab) {
                 
    box.ownerCt.setSize(box.el.getSize()); 
              }); 
                   }
                }
           
       }], 
       
    renderTodocument.body
    }); 

  3. #13
    Sencha User
    Join Date
    Jul 2011
    Posts
    13
    Vote Rating
    1
    silan is on a distinguished road

      0  

    Default


    Hi Stroker,
    Thanks for the response. However, I was just try to adjust the panel base on image height, not the whole size, since I still have other content on the panel, and the panel width is mainly determined by the parent window size.
    I do found the autoHeight actually works with forefront picture, not background. So I resoved my problem by using foreground picture, though it's not an idea solution.
    Again, thanks for sharing your idea!

  4. #14
    Sencha User
    Join Date
    Sep 2012
    Posts
    1
    Vote Rating
    0
    nidhikumar05 is on a distinguished road

      0  

    Default Accordion :How to get an accordion panel to fit to the size of panel that contains it

    Accordion :How to get an accordion panel to fit to the size of panel that contains it


    Hi,

    I am trying to built a UI using ExtJS 4.0.7 and I have few forms in the panel. I am trying to use accordion feature only for 2 forms in my panel which has dynamic content in it but when checked Sencha site, it says to define the height for the page due to which I am not able to expand my panel dynamically according to the content it contains. Please help me with that.

    Regards,
    Nidhi

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