Results 1 to 4 of 4

Thread: [CLOSED] [3.0rc1] .getLayout() return 'card' not ContainerLayout

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
      0  

    Default [CLOSED] [3.0rc1] .getLayout() return 'card' not ContainerLayout

    Hi,
    I have a Panel with layout:'card'. When I call panel.getLayout() it returns only the string 'card' and not the ContainerLayout object. Is this a bug? I need to get the layout instance to setActiveItem, but not sure if there is another way.

    Thanks for any tips.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,644
    Vote Rating
    61
      0  

    Default

    Before it's rendered, the layout will be whatever layout string you specify. Configs get assigned to the object.
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  3. #3
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Vote Rating
    147
      0  

    Default

    Sesshomurai -

    What is occurring is that you are accessing the layout configuration before it is turned into a layout manager. Take a look at the Ext 2.0 Overview which also applies to Ext 3 and the component life cycle. Where are you accessing getLayout()? Try it later in the component life cycle and you will find that the layout is now an instance of a CardLayout Manager.
    Aaron Conran
    @aconran

  4. #4
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
      0  

    Default

    Hey guys,
    My call to panel.getLayout() was after the panel was instantiated. That's why I was expecting ContainerLayout to be returned by getLayout(). But the panel _may_ not have been rendered yet.

    But I will re-structure it properly. As a workaround, I just created an instance of CardLayout (hehe, I know the docs prefer not to) during creation, but it allowed my code to be better encapsulated in some places.

    Gratzie!

Posting Permissions

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