View Full Version : Ext.getCmp().getLayout() behavior in Safari

6 Dec 2010, 1:01 AM
After creating an accordion layout I try to set the active accordion by using the following code
Ext.getCmp('regionName').getLayout().setActiveItem('accordionName'). This resulted in an exception in the Safari browser.On checking in the web inspector console of safari I found that Ext.getCmp('regionName').getLayout() method returned "accordion" (the string itself). Whereas it returns the layout object in firebug(in firefox). Can anyone please tell me the reason behind this different behavior in Safari? Should I be using a different method instead ?

6 Dec 2010, 1:26 AM
The layout object is created from the string in the afterRender method of the container.

If you still get a string at that point then you are trying to call getLayout too early.

17 Dec 2010, 1:17 AM
Sorry to come back so late to thank you :). I called the getLayout method in the afterRender event and it worked. Weirdly, setting the content-type to text/html also works without even shifting the call to the afterRender event. Any idea on why this happens? :-/