Results 1 to 3 of 3

Thread: BufferedRenderer and Grid Auto Height in ExtJS 5

  1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    36

    Default Answered: BufferedRenderer and Grid Auto Height in ExtJS 5

    Hi

    I was wondering whether any one could show me how to set/get a grid to fill its parent container (usually a panel or normal container) when the grid uses bufferedrenderer. If set the layout to 'fit', I get the exception
    Code:
    Cannot use buffered rendering with auto height
    If I explicitly set the the grid height, everything works. My problem is that I do not know the grid height or its parent container height in advance (the heights are dynamic).

    How can I set the grid height to automatically fill the parent container when the grid uses buffered rendering. If I dont use buffered rendering, then everything works OK. This used to work in Ext 4.2.2 but it seems something has been changed in Ext 5 which has broken this

    PHP Code:
      var grid Ext.create('Ext.grid.Panel', {
                            
    store:myStore,
                            
    layout: : 'fit',
                            
    selType'cellmodel',
                             
    //WORKS IF I EXPLICITLY SET THE GRID HEIGHT
                            //height: 500,
                            
    itemId:my-grid,
                            
    borderfalse,
                            
    plugins: [
                                                  
    Ext.create('Ext.grid.plugin.CellEditing', {
                                                      
    clicksToEdit1
                                                  
    }),
                                {
                                    
    ptype'bufferedrenderer',
                                    
    trailingBufferZone20,
                                    
    leadingBufferZone20   
                                
    }
     
                        });

    var 
    panel Ext.create('Ext.panel.Panel',
                                        {
                                        
    layout:'fit',
                                        
    items:grid
                                         
    }); 

  2. Please see the following test case:
    https://fiddle.sencha.com/#fiddle/cam

    You will need to get the height from somewhere. Either a parent container with a fit layout, or a specified height for the grid.

    >>>This used to work in Ext 4.2.2
    In the fiddle, you can set the version to Ext 4.2.2 and it still does not work. A height is needed.
    Ext5 simply alerts you to the config requirement in the console.

    btw, the layout: 'fit' you have in the grid is moot. This is for a parent container with a child item.

    Scott.

  3. #2
    Sencha - Support Team
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Please see the following test case:
    https://fiddle.sencha.com/#fiddle/cam

    You will need to get the height from somewhere. Either a parent container with a fit layout, or a specified height for the grid.

    >>>This used to work in Ext 4.2.2
    In the fiddle, you can set the version to Ext 4.2.2 and it still does not work. A height is needed.
    Ext5 simply alerts you to the config requirement in the console.

    btw, the layout: 'fit' you have in the grid is moot. This is for a parent container with a child item.

    Scott.

  4. #3
    Sencha User
    Join Date
    Apr 2013
    Posts
    36

    Default

    Hi scottmartin ,
    You are right. looks like I am going to have to get the height from somewhere. Thank for the help

Tags for this Thread

Posting Permissions

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