extjs user
extjs user

Reputation: 263

Extjs 4 newline character in column header text

In my grid columns header/text are very long and I want to display it in 2-3 line, depends on requirement. Customer will put all this entry in a file with "\n" as new line character.

How to implment it in Extjs 4.1???

Note : 'br/>' works fine but all files created by end user with "\n" not with 'br>'.

Thanks.

Upvotes: 1

Views: 4256

Answers (2)

Alexey Solonets
Alexey Solonets

Reputation: 817

Use cls property for the column:

columns: [{
    header: 'Multiline',
    dataIndex: 'MyProp',
    cls: 'multiline'
}]

And then modify css file

.multiline .x-column-header-inner .x-column-header-text { white-space: normal; }

Upvotes: 3

Muchiano
Muchiano

Reputation: 106

You can set this property in your css style:

.x-column-header-inner .x-column-header-text { white-space: pre-wrap; }

Pre-wrap info: http://www.w3schools.com/cssref/pr_text_white-space.asp

Upvotes: 2

Related Questions