PDA

View Full Version : [FIXED-1080] activeItem check throws error on incorrect layout.



WixSL
26 Jun 2010, 10:22 PM
Setting "activeItem" config parameter to a panel that has a layout other than an AccordionLayout or CardLayout throws the following error after rendering the panel:

"this.layout.setActiveItem is not a function"

Ext v3.2.x

Just edit the panel example in ext-3.2.1/examples/panel/panel.js and add to the first panel definition "activeItem:0".


var p = new Ext.Panel({
title: 'My Panel',
collapsible:true,
renderTo: 'panel-basic',
activeItem: 0, //<----------------
width:400,
html: Ext.example.bogusMarkup
});


I know that you shouldn't use activeItem in a layout that doesn't support it, but i've been struggling for some time with this error on my page load until i release that i was putting this atributte accidentally in a diferent layout.
So, i thougt that even when useing in a wrong layout, the error shoulden't come up, stopping the execution of the script.