Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: long text in grid cell

  1. #1
    Sencha User
    Join Date
    Jun 2008
    Posts
    77

    Question long text in grid cell

    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:
    Code:
    renderer:function(value,meta){ 
         meta.attr='style="white-space:normal"'; 
         return value; 
    },
    ...but how to solve this problem on ext-4.0 ?

    Thanks!

  2. #2
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    462

    Default

    I overrode the x-grid3-cell-inner style in Ext 2-3. Now you can override the x-grid-cell-inner like

    Code:
     
    <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

  3. #3
    Sencha User
    Join Date
    Jun 2008
    Posts
    77

    Default

    thanks!!! its work...

  4. #4
    Sencha User
    Join Date
    Jun 2008
    Posts
    77

    Default

    ...but its global changes (

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

    Who know other ideas how to solve this problem?

  5. #5
    Ext JS Premium Member
    Join Date
    Apr 2011
    Posts
    53

    Default

    I also would like to see smarter ways to handle text overflow in grid cells.
    "Ellipsis" vs "text wrap/multiline" vs "text hide".

  6. #6
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    462

    Default

    Quote Originally Posted by eja40 View Post
    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...

  7. #7
    Sencha User
    Join Date
    Jun 2008
    Posts
    77

    Exclamation

    EXT Team, we believe in you!

  8. #8
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    462

    Default

    Quote Originally Posted by PSB View Post
    ...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.

  9. #9
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676

    Default

    renderer still exists:

    Code:
                // 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
                    );
                }
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  10. #10
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    462

    Default

    Quote Originally Posted by steffenk View Post
    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

Page 1 of 2 12 LastLast

Similar Threads

  1. [RESOLVED] [Extjs 3.2] grid cell with long string inside
    By senacle in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 2 May 2010, 10:45 PM
  2. Replies: 0
    Last Post: 5 Dec 2007, 11:20 AM
  3. Form - text too long
    By ralficzek in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 2 Aug 2007, 6:49 AM
  4. some advice about parse a long text.
    By franklt69 in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 20 Jun 2007, 2:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •