Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple lines of text in extjs grid panel cell

Tags:

html

css

extjs3

I have a gird. I want to display multiple lines in some grid cells. Following is the div that I am generating which has two lines of text. But this is not rendering the second line i.e. "test new line".

<div class="x-grid3-cell-inner x-grid3-col-event x-unselectable" style="height:134px;line-height:134px;" unselectable="on">
  <div>
      <a href="some link">XYZ funding round: Series C</a> (Funding Round)
      <br>
      test new line
  </div>
</div>

It is an extjs 3.4 grid.

Any idea why this would not render two lines?

like image 861
Pratik Patel Avatar asked Jan 11 '23 00:01

Pratik Patel


1 Answers

I solved this problem with grid's viewConfig option:

viewConfig: {
    loadingText: lang.loading,
    loadMask: true,
    stripeRows: true,
    getRowClass: function(record, rowIndex, rowParams, store) {
        return 'multiline-row';
    }
},

and in the CSS file:

.multiline-row .x-grid-cell-inner {
    overflow: auto !important;
    white-space: normal !important;
    text-overflow: ellipsis;
    display: block;
}

And works fine in ExtJS 4.

Hope it helps.

like image 73
Andres Baena Avatar answered Jan 22 '23 12:01

Andres Baena