talha06
talha06

Reputation: 6466

Ext JS - Multiline display field

I display a multi-line textarea in a displayfield but the text is shown as concatenated instead of line by line.

Here is the sample fiddle: https://fiddle.sencha.com/#fiddle/10f6

How can I make the text to be displayed in displayfield in exactly same way with textarea?

Upvotes: 2

Views: 3764

Answers (1)

CD..
CD..

Reputation: 74096

You can use a renderer, like:

renderer: function(value){
  return value.replace(/\n/g, '<br>');
}

For example: https://fiddle.sencha.com/#fiddle/10f8

Upvotes: 3

Related Questions