PDA

View Full Version : How to automatically break text lines



cougar83
22 Oct 2010, 12:42 AM
Hi Forum,

it's a beginner question: How can I force to break text lines for a flexible text area? I have a Window with a textfield component and use the Ext.layout.FitLayout



function getInfoWindow() {
return new Ext.Window({
title: 'INFO',
text: 'Please note: The changes are not saved until you press the Save button',
x: 10,
y: 200,
width: 200,
height: 100,
layout: 'fit',
items: [{
xtype: 'textfield',
value: 'Please note: The changes are not saved until you press the Save button',
readOnly: true
}]
})
}

Condor
22 Oct 2010, 1:39 AM
TextField doesn't support linebreaks. You want a TextArea.

In a textarea you can insert \n characters to force linebreaks, but it will also wrap by default.