PDA

View Full Version : long text in grid cell



PSB
26 Feb 2011, 7:48 AM
Hello!

I'm testing ext-4.0-pr2 and in my code contain grid cell width long text.

In ext 3.X I'm using:


renderer:function(value,meta){
meta.attr='style="white-space:normal"';
return value;
},


...but how to solve this problem on ext-4.0 ?

Thanks!

firefoxSafari
27 Feb 2011, 10:53 AM
I overrode the x-grid3-cell-inner style in Ext 2-3. Now you can override the x-grid-cell-inner like




<style type="text/css">
.x-grid-cell-inner { white-space:normal !important; }
</style>


I asked in another thread about making text wrapping and selecting text in a grid config options and a member of the dev team indicated this might make it into the final release. Hopefully more people asking for it like this will increase the chances :D

PSB
5 Mar 2011, 12:47 AM
thanks!!! its work...

PSB
5 Apr 2011, 8:00 AM
...but its global changes (

...and after hide this column - grid looks horrible

Who know other ideas how to solve this problem? :-/

eja40
5 Apr 2011, 9:56 AM
I also would like to see smarter ways to handle text overflow in grid cells.
"Ellipsis" vs "text wrap/multiline" vs "text hide".

firefoxSafari
5 Apr 2011, 3:48 PM
I also would like to see smarter ways to handle text overflow in grid cells.
"Ellipsis" vs "text wrap/multiline" vs "text hide".

+1

Couldn't agree more. I really hope this will make it into the final release. I'd just like to reiterate that I would love smarter ways to handle the overflow in column headers as well as the cells. Multiline column headers are very important to me...

PSB
6 Apr 2011, 3:18 AM
EXT Team, we believe in you! ;)

firefoxSafari
6 Apr 2011, 5:40 AM
...but its global changes (

...and after hide this column - grid looks horrible

Who know other ideas how to solve this problem? :-/

I played around with localizing this to a particular grid column but didn't have much luck. The documentation for renderer is still a bit spotty. I tried wrapping the value the renderer returns in a div with a class that had the 'white-space:normal' and this seemed to work, but hiding the column still resulted in lots of extra space in the remaining cells. Ext grids are now just one table, so maybe the cells aren't as insulated from each other as they used to be. Might try overriding the grid internals that generate the markup, but this seems like a hack and kind of defeats the purpose of using Ext in the first place...

It looks like the days of a simple css / style override for this might be gone - hopefully the Ext team can give us something.

steffenk
6 Apr 2011, 1:30 PM
renderer still exists:


// When specifying a renderer as a string, it always resolves
// to Ext.util.Format
if (Ext.isString(header.renderer)) {
header.renderer = Ext.util.Format[header.renderer];
}

if (Ext.isFunction(header.renderer)) {
value = header.renderer.call(
header.scope || this.ownerCt,
value,
// metadata per cell passing an obj by reference so that
// it can be manipulated inside the renderer
metaData,
record,
rowIdx,
colIdx,
store,
view
);
}

firefoxSafari
7 Apr 2011, 5:48 AM
renderer still exists:


Thanks, I saw this as well. My point was that I couldn't find it in the documentation anymore and therefore was leary of the developers having plans to change it.

In any case, trying to set white-space: normal from a renderer in any manner (tdCls, style, wrapping value in your own div) didn't work well. While I could get multiline text to work, like to OP said hiding columns breaks it. If anyone has a simple way to make this work I'd love to hear it ;)

PSB
4 May 2011, 12:59 PM
BUMP

firefoxSafari
4 May 2011, 1:35 PM
BUMP++

I'm very interested in multiline column headers as well. This seems like it should be simple and I've been asked by multiple users for it - raw HTML tables handle it with no problem - but we've yet to see a great alternative in an Ext-JS grid, especially with version 4 now that the old css overrides don't work as well...

firefoxSafari
4 May 2011, 1:37 PM
Offtopic rant - PLEASE fix the Preview Post button. It seems amazing that this still submits without warning... how many more people have to report it?