Search code examples
extjsextjs4extjs4.1extjs4.2

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?


Solution

  • You can use a renderer, like:

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

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