PDA

View Full Version : Problem with Wrap Text in Grid and Hiding Columns



pnguyen02
15 Aug 2012, 10:13 AM
Hey,

I am having this problem with wrap text on the grid. When I hide a column on the grid the rows expands(height) and makes the grid look nasty...

I currently have a fix for it, but my problem is on the load of the page i still want the text to be wrapped on the grid column. With the fix if I hide and then show the columns then it works.

my code:

td.wrap div {
white-space: normal;
}


function removeCls()
{
Ext.get(Ext.query('.placeholder')).removeCls('wrap');
}

function addCls()
{
Ext.get(Ext.query('.placeholder')).addCls('wrap');
}


var grid = Ext.create('Ext.grid.Panel', {
columns : [{
text : 'Hello',
tdCls : 'placeholder',
listeners: {'beforehide': removeCls, 'beforeshow': addCls}
}]
});


Any suggestions?

scottmartin
6 Oct 2012, 3:49 PM
Have a look at this thread:
http://www.sencha.com/forum/showthread.php?237681/

Assign the CSS to a specific column

Scott.