PDA

View Full Version : PortalPanel will fail if contains no items



zombeerose
27 Jul 2011, 10:36 AM
The beforeLayout method of the PortalPanel UX will fail if it is called with no items.



beforeLayout: function() {
var items = this.layout.getLayoutItems(),
len = items.length,
i = 0,
item;

for (; i < len; i++) {
item = items[i];
item.columnWidth = 1 / len;
item.removeCls(['x-portal-column-first', 'x-portal-column-last']);
}
if (len > 0){
items[0].addCls('x-portal-column-first');
items[len - 1].addCls('x-portal-column-last');
}
return this.callParent(arguments);
},


Highlighted in green is my suggested patch.