Results 1 to 8 of 8

Thread: GridPanel - column text truncated

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    31

    Default GridPanel - column text truncated

    Hello,

    in my GridPanel when a column text is too long is truncated with "..."

    How can I prevent it? I need something like this:

    snap.JPG

    Is it possible?

    Thank you.

  2. #2
    Sencha User laurentParis's Avatar
    Join Date
    Aug 2010
    Location
    paris
    Posts
    246

    Default

    you can use css "white-space: normal;" on cells

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    31

    Default

    I've tried with this renderer function and it works good!

    Code:
    function arg(val){
            return '<div style="white-space:normal;">' + val + '</div>';
    }
    Thank you!

  4. #4
    Sencha User laurentParis's Avatar
    Join Date
    Aug 2010
    Location
    paris
    Posts
    246

    Default

    it will be more efficient to use this code if arg method is your renderer method
    PHP Code:
    function arg(valmeta){
            
    meta.css += ' white-space-normal';
            return 
    Ext.util.Format.htmlDecode(val);
    }
    ...
    into your css file add this line :
    .
    white-space-normal {white-space:normal;} 

  5. #5
    Sencha User
    Join Date
    Sep 2010
    Posts
    31

    Default

    I've tried this:

    Code:
    function arg(val, meta){      
        meta.style = 'white-space:normal;';
        return Ext.util.Format.htmlDecode(val);
    }
    but it doesn't give me the same result... what's wrong?

  6. #6
    Sencha User laurentParis's Avatar
    Join Date
    Aug 2010
    Location
    paris
    Posts
    246

    Default

    I'm not sure that style is supported by meta argument
    try with css, it's better than using style

  7. #7
    Sencha User
    Join Date
    Sep 2010
    Posts
    31

    Default

    Quote Originally Posted by laurentParis View Post
    it will be more efficient to use this code if arg method is your renderer method
    PHP Code:
    function arg(valmeta){
            
    meta.css += ' white-space-normal';
            return 
    Ext.util.Format.htmlDecode(val);
    }
    ...
    into your css file add this line :
    .
    white-space-normal {white-space:normal;} 
    Now it works... but I modified ext-all.css:

    Code:
    .x-grid3-cell-inner, .x-grid3-hd-inner{
    	overflow:hidden;
    	-o-text-overflow: ellipsis;
    	text-overflow: ellipsis;
        padding:3px 3px 3px 5px;
        /*white-space: nowrap; with this setting the function doesn't work*/
    }
    Is it possible or I'm wrong?

  8. #8
    Sencha User laurentParis's Avatar
    Join Date
    Aug 2010
    Location
    paris
    Posts
    246

    Default

    you can create your own css file or add in your html file into head tag
    Code:
    <style type="text/css">
    .white-space-normal {white-space:normal;}
    </style>
    


    Ps: don't modify ext-allxxxx.js or ext-all.css... never !

Similar Threads

  1. Replies: 0
    Last Post: 25 Oct 2009, 11:27 PM
  2. the enabled combobox are truncated
    By caam in forum Ext 1.x: Bugs
    Replies: 0
    Last Post: 17 Apr 2008, 6:54 AM
  3. Grid column truncated with ellipses
    By migo_config in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 20 Nov 2007, 10:28 AM
  4. Replies: 5
    Last Post: 1 May 2007, 2:53 AM

Posting Permissions

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