View Full Version : [Solved]Word-Wrap in grid cells

21 Sep 2010, 2:23 AM
I want my text inside the Grid cells to word-wrap instead of getting hidden. I tried setting the 'css' property of Ext.grid.Column to 'white-space:normal', but I found that it gets overridden by the ".x-grid3-cell-inner" class which sets white-space:nowrap. Can anyone help me in overriding this? I cannot modify the "x-grid3-cell-inner" class I need wrapped text only in a few grids in the application.This is how the cell is getting created -

<td tabindex="0" style="white-space: normal; word-wrap: break-word;" class="x-grid3-col x-grid3-cell x-grid3-td-error ">
<div unselectable="on" class="x-grid3-cell-inner x-grid3-col-error">
This text needs to be wrapped
</div></td>Unfortunately I cannot create a CSS class with my Grid Id (http://www.sencha.com/forum/showthread.php?25558-GridPanel-on-GroupingView-word-wrap-in-cells) as my Grid Id is dynamic. Also I did try mentioning css : 'white-space:normal !important'

21 Sep 2010, 2:34 AM
.x-grid3-cell-inner {white-space: normal !important;}
should do the job

21 Sep 2010, 2:37 AM
Thanks for your quick reply.I cannot override .x-grid3-cell-inner as I need this only for certain grids in my application , and not all the Grids.

21 Sep 2010, 2:48 AM
I got it, I tried the solution posted (http://www.sencha.com/forum/showthread.php?100380-Wrap-text-in-a-grid-cel)by PerlDiver. Thanks