Results 1 to 6 of 6

Thread: fit scrollbars in grid cell with custom renderer

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    31

    Default fit scrollbars in grid cell with custom renderer

    I can put a list in grid cell using a custom renderer. (Ext is so cool!) but I want the vertical scroll bar to fit into the cell. What happens is that a horizontal scrollbar is created and if I scroll over I can see the vertical bars. Maybe the fix is obvious to someone with more experience but not to me! Here is the renderer:
    Code:
        function cprender(val,cell,record,row,column,ds)
        {
        	
        	var x = '<div style="overflow:auto;"><select name="Morefruit" size="4"><div style="overflow:hidden;"><option selected>Apples</option>';
    		x += 	'<option>Bananas</option><option>Oranges</option><option>Watermelon</option>';
    		x +=	'<option>Kiwi</option></div></select></div>';
    		return x;
        }
    Get cell size? Then do something with it?
    Thanks

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    I would consider using combo editor in this case.

  3. #3
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    Some more thoughts....

    Renderer RENDERS data, combo is an input of data. That would mean I wouldn't put combo in renderer as user could be confused that he/she can edit the value. I would use combo in the editor only.

    By the way, have you watched those 2 screencasts on grid that you can find somewhere in this forum?

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    I don't think you're gonna have much success making that do what you want x-browser. I would suggest that use a combo control - see the edit-grid example.

  5. #5
    Ext User matjaz's Avatar
    Join Date
    Apr 2007
    Location
    Slovenia
    Posts
    126

    Default

    Div tag inside of select ?
    This isn't even a valid HTML !

  6. #6
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    Sorry, I don't understand your last post.

    That what looks like select element in Ext is much more than simple html select element. Use firebug to find out.

Posting Permissions

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