PDA

View Full Version : How to set "stretch" align for dockedItems?



cwtuan
23 Jul 2012, 2:33 AM
Ext.define('myPanel', {
extend : 'Ext.panel.Panel',
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [{
layout: {
align: 'stretch' // doesn't work?
},
xtype: 'textfield',
value: 'Type something'
}]
}]
});


why doesn't textfield stretch in this example?

Romick
23 Jul 2012, 2:41 AM
Hi! You are place layout in wrong place.

Ext.define('myPanel', {
extend : 'Ext.panel.Panel',
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
layout: 'fit',// work?
items: [{
xtype: 'textfield',
value: 'Type something'
}]
}]
});

friend
23 Jul 2012, 4:00 AM
I think this is what you're after, where I embedded your panel config in a Window for ease of testing:




Ext.create('Ext.window.Window', {
height: 400,
width: 400,
items: [{
xtype: 'panel',
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [{
xtype: 'textfield',
flex: 1,
value: 'Type something'
}]
}]
}]
}).show();