• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

How to wrap text in a grid column

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to wrap text in a grid column

    Hi,

    I have some columns that contains data normally within 40 characters, but sometimes it contains 200 chars. In case the text exceeds 40 chars I would like to wrap the text.

    I already have some customised formatting in this column:

    var markup = '<strong>{0}</strong><br>{3}-{2}-{1}<br>@ {4}',
    UPSstatus = v,
    statusyear = rec.get('STATUSYEAR'),
    statusmonth = rec.get('STATUSMONTH'),
    statusday = rec.get('STATUSDAY'),
    statustime = rec.get('STATUSTIME');

    if (statusyear !== 1){
    return Ext.String.format(markup,UPSstatus,statusyear,stat usmonth,statusday,statustime);
    }
    return '-';

    So I like to format the v value with additional line breaks so it stays within 40 chars.

    Can you help me with that or point me to the right ExtJs documentation?

    Regards,
    Theo



  • #2
    Hi Theo -

    I would suggest wrapping your entire return within <div style="white-space:normal;">YOUR_MARKUP</div>

    Comment


    • #3
      Thanks, that works fine.

      Comment

      Working...
      X