Ext.layout.AccordionLayout icon indicating copy to clipboard operation
Ext.layout.AccordionLayout copied to clipboard

Empty items

Open qpi opened this issue 14 years ago • 0 comments

If you don't set any 'items' property, or the 'items' property is empty (set it later), the layout throws an error.

Uncaught TypeError: Cannot read property 'el' of undefined Ext.layout.AccordionLayout.js:313

I checked the code, and the 'items' occured 3 times. I modified the functions in this way:

collapseAll: function() { if (typeof items == 'undefined' || items.length == 0 ) return; //my modification ...... getActiveItem: function() { var me = this; if (typeof me.owner.items == 'undefined' || me.owner.items.length == 0 ) return null; //my modification ...... getExpandHeight: function() { if (typeof items == 'undefined' || items.length == 0 ) return 0; ......

After these modifications, the code seems to work correctly.

qpi avatar Aug 24 '11 13:08 qpi