View Full Version : Linefeed in column

11 Nov 2010, 11:04 AM
Hi again,

I need to include an automatic linefeed to a column of a grid.
I canīt find any matching options or properties in the API for GridPanel, ColumnModel or Column.

How can I solve this?


11 Nov 2010, 11:38 AM
Assuming your data has real line feeds in them as in
var text = 'One\nTwo'; then use a renderer function (in the column config) which converts newlines to html <br/> tags. Don't forget that if your source data is text which could contain html markup that you want displayed verbatim you need to html escape.

function multilineRenderer(s) {
return Ext.util.Format.nl2br(Ext.util.Format.htmlEncode(s));