1. #1
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default layout() of BorderLayout on hidden tab

    layout() of BorderLayout on hidden tab


    I have a complex web of interaction!

    My main page has my ListManager on it which creates a BorderLayout with a Grid in north, and several ContentPanels added as tabs to the center.

    A couple of those ContentPanels create ListManagers.

    My ListManager puts the class "asp-listmanager" on its container, and when created, scans up the parentNode axis, and finds its containing ListManager. If it finds one, it sets monitorWindowResize to false in its own BorderLayout, and subscribes to the parent ListManager's "layout" event.

    This works great, all my child ListManagers lay themselves out when I collapse the parent's north region.

    Problem is, that in hidden tabs the width gets set to zero, so when I next visit that tab, I see blue.

    tweaking the browser window to resize triggers the main ListManager's layout, which causes the ListManager in the blank tab to lay itself out, and it reappears.

    This is a bug? Or is calling layout() on a BorderLayout on a hidden tab forbidden?

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Did you try calling layout when the tab is activated?

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    It doesn't know to do that.

    The ListManagers in the tabs subscribe to the parent ListManager's "layout" event (it extends Observable). That's how they know when to re-do their layouts.

    The parent ListManager doesn't have a clue what is in the content it has been configured to load into it's center "Detail" region. It just creates a load of ContentPanels, adds them to the region and then, sets their URLs. From then on, it calls the new refresh() on visible ones when its row selection changes, and sets the active state to false on hidden ones.

    Why is it calculating the width as zero? isn't all the layout stuff done with "visibility:hidden" now, so that measuring works?

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    I don't know what's going on to be honest. The only thing I can think of is hideOnLayout. Do you have that set to true anywhere?

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    No.

    I'll have a look at the layout code...

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Well this turned out to be fitToFrame:true with autoWidth:true on the ContentPanel, and autoScroll:false on the Region.

    I got it the wrong way round. As you said in another thread, the ContentPanels, should usually size themselves fitToFrame:false, and have the Region's autoScroll:true allow the Region to scroll any ContentPanel that has lots of data in it, and has a large height.

    getViewSize() on a BorderLayout, which is also a hidden ContentPanel (hidden using visibility:hidden;position:absolute;top:-20000px;left:-20000px) with width:auto returns zero width. The absolute positioning zeroes the offsetWidth.

    This area is quite fragile!

Similar Threads

  1. Replies: 4
    Last Post: 19 Feb 2007, 6:40 PM
  2. Hidden Column Headers
    By willpage in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 16 Jan 2007, 3:05 PM
  3. YUI CSS layout versus YUI-ext BorderLayout
    By sjivan in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 5 Dec 2006, 11:43 AM
  4. BorderLayout fails to layout if no config for region
    By barrygently in forum Ext 1.x: Bugs
    Replies: 16
    Last Post: 27 Nov 2006, 5:54 PM
  5. Layout Error: YAHOO.ext.BorderLayout is not a constructor
    By jay@moduscreate.com in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 24 Oct 2006, 5:32 PM

Thread Participants: 1