Reputation: 10802
I want displayfield
to span multiple lines, when there is some large content inside. I tried many configurations and css-styling, but to no avail. If there is no quick solution, could you please advise me another component, that I could use instead of displayfield
.
Upvotes: 0
Views: 3582
Reputation: 21
This answer is for ExtJS 4.2 - not sure about later versions.
The sass definition file at ext/packages/ext-theme-neutral/sass/src/form/field/Display.scss
has a height definition, using $form-field-height
. If this height is removed, then the field will expand/contract based on the content within.
Upvotes: 0
Reputation: 429
assign width and height config explicitly and if it is not enough use maxWidth and maxHeight configs
check out :
http://jsfiddle.net/acteon/p46v3/
{
xtype: 'displayfield',
value: 'line 1 aasdasdasdasdasdasd line 2 ad asd asd asd asd asdasd',
fieldLabel: 'multiLineField',
width : '20%'
}
Upvotes: 2
Reputation: 10802
Oh, I used textarea
with readOnly
set to true
. It works almost as I want.
Upvotes: 0