PDA

View Full Version : [DUP][CLOSED]collapsible: true items in anchor layout incorrectly calculates width



kmiyashiro
28 Feb 2011, 9:52 AM
1. Create a panel with anchor layout that is too small to show all of its items, autoscroll on or off (different bugs)
2. Create a bunch of collapsible panels in that panel
3. Collapse and uncollapse the panels, see the widths be incorrectly calculated in a variety of ways
4. Uncomment anchor: '100%', resize the browser window smaller. Then do it again. Every other time you resize the window smaller, the widths of the children get reset to about 22px or 25px.

There seems to be a ton of different bugs, can't really list them all.

There's another bug where defaultAnchor doesn't actually work right, whereas defaults: { anchor: '100%' } does what defaultAnchor is supposed to do. I'll open another thread.

Sample code (make browser window small so scrollbars appear):

Ext.define('ACME.dessert', {

extend: 'Ext.Panel',
alias: 'widget.dessert',

initComponent: function() {

var defConfig = {
title: 'Dessert',
xtype: 'form',
layout: {
type: 'hbox',
align: 'stretch',
defaultMargins: {
top: 10,
right: 10,
bottom: 10,
left: 10
}
},
tbar: {
items: [{
text: 'Save',
}]
}
};

Ext.applyIf(this, defConfig);

this.callParent();
},
items: [
{
title: 'Treats',
flex: 1,
autoScroll: true,
layout: {
type: 'anchor',
defaultAnchor: '100%'
},
defaults: {
draggable: true,
bodyPadding: 10,
// anchor: '100%',
collapsible: true,
collapsed: true,
titleCollapse: true,
hideMode: 'offsets',
items: [
{
xtype: 'fieldset',
title: 'Cookies'
}
]
},
border: true,
items: [
{
title: 'Default'
},
{
title: 'Choco chippers'
},
{
title: 'Default'
},
{
title: 'Default'
},
{
title: 'Default'
}
]
},
{
title: 'Jars',
flex: 1,
border: true,
autoScroll: true,
margins: '10 10 10 0',
items: [
{
title: 'Purple'
},
{
title: 'Silver'
},
{
title: 'Gold'
}
]
}
]
});

Ext.onReady(function() {
var viewport = new Ext.container.Viewport({
layout: 'fit',
items: [{
xtype: 'dessert'
}]
});
});

Examples of bugs:

http://kellymiyashiro.com/images/screenshots/collapsible/initial.png

http://kellymiyashiro.com/images/screenshots/collapsible/defaultanchor.png

http://kellymiyashiro.com/images/screenshots/collapsible/afterresize.png

http://kellymiyashiro.com/images/screenshots/collapsible/afterresizewidth.png

Animal
28 Feb 2011, 11:34 AM
Duplicate of http://www.sencha.com/forum/showthread.php?125357-defaultAnchor-has-no-effect-on-collapsed-items