PDA

View Full Version : Resizable + wrap + doLayout



Gabor Turi
2 Aug 2010, 8:45 AM
Hi! The wrap goes wrong after doLayout:


var panel = new Ext.Panel({
renderTo: Ext.getBody(),
items: [{
id: 'textarea',
xtype: 'textarea'
}, {
xtype: 'label',
text: ':)'
}]
});
new Ext.Resizable('textarea', {
handles: 's',
minWidth: 60,
wrap: true
});
panel.doLayout();
Why? :)

BlueSkye
2 Aug 2010, 12:28 PM
Hi! The wrap goes wrong after doLayout:


var panel = new Ext.Panel({
renderTo: Ext.getBody(),
items: [{
id: 'textarea',
xtype: 'textarea'
}, {
xtype: 'label',
text: ':)'
}]
});
new Ext.Resizable('textarea', {
handles: 's',
minWidth: 60,
wrap: true
});
panel.doLayout();Why? :)

Had the same problem, but I haven't found out why...
I chose to incapsulate my components in HTML <div>s and then apply the resizer to the external div...

resizer = new Ext.Resizable('myDiv', {... });

But I guess someone will suggest you a more elegant and professional way to solve this problem...

Gabor Turi
3 Aug 2010, 4:54 AM
My solution: overwrite the positionEl:

var panel = new Ext.Panel({
renderTo: Ext.getBody(),
items: [{
ref: './textarea',
xtype: 'textarea'
}, {
html: ':)'
}]
});
var resizer = new Ext.Resizable(panel.textarea.id, {
handles: 's',
minWidth: 60,
wrap: true
});
panel.textarea.positionEl = resizer.el;
panel.doLayout();This works, but ...? :)