-
10 May 2009 8:07 AM #1
[CLOSED] [3.0rc1] .getLayout() return 'card' not ContainerLayout
[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.
-
10 May 2009 8:20 AM #2
Before it's rendered, the layout will be whatever layout string you specify. Configs get assigned to the object.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
10 May 2009 8:20 AM #3
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
Sencha Architect Development Team
-
10 May 2009 5:38 PM #4
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!


Reply With Quote