Search code examples
extjsextjs4

ExtJS 4. How to make displayfield multiline to fit its content?


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.


Solution

  • 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%'
           }