1. #1
    Ext JS Premium Member
    Join Date
    Mar 2010
    Posts
    21
    Vote Rating
    0
    Maarten76 is on a distinguished road

      0  

    Default TreePanel sometimes looks collapsed (height not set?)

    TreePanel sometimes looks collapsed (height not set?)


    Very occasionally, a TreePanel which is used in software I've built does not have the correct height.

    Screen Shot 2012-12-11 at 11.45.20 AM.png

    This only happens in Chrome and Windows XP. It doesn't happen all of the time. I used several machines with the same setup and only some of them have this problem.

    The code of the treepanel is this:

    Code:
    var ouTreePanel = new Ext.tree.TreePanel({        id: 'ou-tree-panel'
            ,layout: 'fit'
            ,frame: false
            ,border: false
            ,autoScroll: false
            ,rootVisible: false
            ,root: ouRoot
            ,loader: ouLoader
            ,listeners: {
                'click': selectOrganization
                
            }
        });
    When I have the same treepanel working and I use

    Code:
    Ext.get('ou-tree-panel').setHeight(1);
    it looks the same as in the screenshot. This gives me the impression it has something todo with the layout.

    Any help is really appreciated!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,641
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    What is the parent of the treepanel like? Also, you shouldn't change the layout of the treepanel.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2007
    Location
    Berlin, Germany
    Posts
    853
    Vote Rating
    2
    wm003 is on a distinguished road

      0  

    Default


    I had a similar problem. it seems it happens, when the panel is initially collapsed, thus not rendered and height not set. i solved it by adding an event which does the layout again. You still have a little lag but it works.
    PHP Code:
    ...
                                    
    listeners: {
                                        
    expand : function(p) {
                                            
    p.doLayout();                                        
                                        }
    }
    ...