Results 1 to 3 of 3

Thread: Cannot read property 'offsetHeight' of undefined in BufferedRenderer Broken Ext 5.1

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    36

    Default Cannot read property 'offsetHeight' of undefined in BufferedRenderer Broken Ext 5.1

    Hi all

    It seems that the grid's BufferedRenderer has been broken in Ext JS 5.1. I get an exception

    Uncaught TypeError: Cannot read property 'offsetHeight' of undefined
    when I try and load a grid with data using the default configuration of
    Code:
    bufferedRenderer:true
    By my investigation, this seems to happen if the grid tries / finishes rendering before the grid's store has finished loading. The problem is at line 328 of the BufferedRenderer class of the refreshSize method i.e.

    PHP Code:
    // We are displaying the last row, ensure the scroll range finishes exactly at the bottom of the view body
            
    if (view.all.endIndex === (me.store.getCount()) - 1) {
                
    me.stretchView(viewme.scrollHeight me.bodyTop view.body.dom.offsetHeight);
            } 
    It seems that at that point view.body.dom is null

    The only way that I can get around this is to turn off buffered rendering

    i.e.
    Code:
    bufferedRenderer:false
    A similar issue was reported here https://www.sencha.com/forum/showthr...80#post1098180
    Here is a sample bit of code that can be used to test this


    PHP Code:
    var gridStore Ext.create('Ext.data.Store', {

                           
    model:'MyApp.model.MyAppModel'
                            
                            
    proxy :{
                                
    api: {
                                    
    readSOME_LARGE_DATA_URL,
                                    
    //update: [SOME_UPDATE_URL]
                                
    },
                                
    type'ajax',
                                
                                
    reader: {
                                    
    type'json',
                                    
    rootProperty'Contacts',
                                    
    messageProperty'message'
                                
    },
                                
    writer: {
                                    
    type'json',
                                    
    writeAllFieldstrue,
                                    
    dateFormatPaceGlobalProps.DatePatterns.DayMonthYearTime
                                
    }
                            }
                        });
                      var 
    grid Ext.create('Ext.grid.Panel', {
                            
    title'Simpsons',
                            
    storegridStore,
                          
    //bufferedRenderer:false,
                            
    columns: [
                                { 
    text'Name'dataIndex'name' },
                                { 
    text'Email'dataIndex'email'flex},
                                { 
    text'Phone'dataIndex'phone' }
                            ],
                            
    height600,
                            
    width800,
                            
    renderToExt.getBody()
                        }); 

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report. Can you please post a test case which reproduces the issue?
    https://fiddle.sencha.com/#home

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

    Default

    Hi Gary,

    I cant seem to get it fail in JSFiddle but it certainly does fail in my code. Its pretty much the same thing that was reported on this thread i.e. https://www.sencha.com/forum/showthr...80#post1098180

    In my case the stack trace is
    Code:
    Uncaught TypeError: Cannot read property 'offsetHeight' of undefinedExt.define.refreshSize @ BufferedRenderer.js?_dc=1430402601279:328
    Ext.define.privates.refreshScroll @ Table.js?_dc=1430402601285:3044Ext.define.onResize @ Component.js?_dc=1430402601276:4223
    Ext.Base.Base.addMembers.callParent @ Base.js?_dc=1430402601275:1255Ext.define.onResize @ AbstractView.js?_dc=1430402601300:937
    Ext.define.afterComponentLayout @ Component.js?_dc=1430402601276:2109owner.afterComponentLayout @ LoadMask.js?_dc=1430402601277:442
    Ext.define.notifyOwner @ Component.js?_dc=1430402601277:166
    Ext.define.callLayout @ Context.js?_dc=1430402601286:352
    Ext.define.flushLayouts @ Context.js?_dc=1430402601286:523
    Ext.define.runComplete @ Context.js?_dc=1430402601286:1150callOverrideParent @ Ext.js?_dc=1430402601270:58
    Ext.Base.Base.addMembers.callParent @ Base.js?_dc=1430402601275:1255
    Ext.override.runComplete @ Component.js?_dc=1430402601276:175Ext.define.run @ Context.js?_dc=1430402601286:1131
    Ext.define.statics.flushLayouts @ Component.js?_dc=1430402601276:183
    Ext.define.statics.resumeLayouts @ Component.js?_dc=1430402601276:199Ext.resumeLayouts @ Component.js?_dc=1430402601276:6190
    Ext.define.add @ Container.js?_dc=1430402601277:889
    Ext.define.afterFirstLayout @ FilterField.js?_dc=1430402601281:123
    Ext.define.afterComponentLayout @ Component.js?_dc=1430402601276:2105
    Ext.Base.Base.addMembers.callParent @ Base.js?_dc=1430402601275:1255
    Ext.define.afterComponentLayout @ Container.js?_dc=1430402601277:929Ext.define.notifyOwner @ Component.js?_dc=1430402601277:166
    Ext.define.callLayout @ Context.js?_dc=1430402601286:352Ext.define.flushLayouts @ Context.js?_dc=1430402601286:523
    Ext.define.runComplete @ Context.js?_dc=1430402601286:1150callOverrideParent @ Ext.js?_dc=1430402601270:58
    Ext.Base.Base.addMembers.callParent @ Base.js?_dc=1430402601275:1255
    Ext.override.runComplete @ Component.js?_dc=1430402601276:175
    Ext.define.run @ Context.js?_dc=1430402601286:1131
    Ext.define.statics.flushLayouts @ Component.js?_dc=1430402601276:183
    Ext.define.statics.updateLayout @ Component.js?_dc=1430402601276:246
    Ext.define.updateLayout @ Component.js?_dc=1430402601276:5381Ext.define.onShow @ Component.js?_dc=1430402601276:4278
    Ext.Base.Base.addMembers.callParent @ Base.js?_dc=1430402601275:1255
    Ext.define.onShow @ Component.js?_dc=1430402601270:251
    Ext.Base.Base.addMembers.callParent @ Base.js?_dc=1430402601275:1255
    Ext.define.onShow @ Panel.js?_dc=1430402601271:2423
    Ext.Base.Base.addMembers.callParent @ Base.js?_dc=1430402601275:1255
    Ext.define.onShow @ Window.js?_dc=1430402601278:542
    Ext.Base.Base.addMembers.callParent @ Base.js?_dc=1430402601275:1255
    Ext.define.onShow @ Window.js?_dc=1430402601271:10
    Ext.define.show @ Component.js?_dc=1430402601276:5082
    Ext.define.createAndShowTransitionWindow @ CircuitHome.js?_dc=1430402601272:734(anonymous function) @ Function.js?_dc=1430402601275:164
    Ext.Function.ExtFunction.defer @ Function.js?_dc=1430402601275:370(anonymous function) @ PaceTabPanel.js?_dc=1430402601279:40fire @ Event.js?_dc=1430402601281:387doFireEvent @ Observable.js?_dc=1430402601275:654prototype.doFireEvent @ EventDomain.js?_dc=1430402601290:293fireEventArgs @ Observable.js?_dc=1430402601275:587fireEvent @ Observable.js?_dc=1430402601275:540Ext.define.fireHandler @ Button.js?_dc=1430402601271:1452Ext.define.onClick @ Button.js?_dc=1430402601271:1438fire @ Event.js?_dc=1430402601281:387Ext.define.fire @ Dom.js?_dc=1430402601276:360Ext.define.publish @ Dom.js?_dc=1430402601276:332Ext.define.doDelegatedEvent @ Dom.js?_dc=1430402601276:391Ext.define.onDelegatedEvent @ Dom.js?_dc=1430402601276:372(anonymous function) @ Function.js?_dc=1430402601275:145

Similar Threads

  1. [INFOREQ] TypeError: Cannot read property 'offsetHeight' of null
    By koroglu in forum Ext 5: Bugs
    Replies: 8
    Last Post: 17 Jun 2015, 4:58 AM
  2. Cannot read property 'log' of undefined
    By alexander.urban in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 26 Jan 2015, 7:12 AM
  3. Replies: 3
    Last Post: 16 Dec 2014, 7:13 AM
  4. Can not read property 'fn' of undefined
    By bee in forum Ext: Q&A
    Replies: 6
    Last Post: 7 Sep 2011, 1:56 PM
  5. Help: Cannot Read Property 'id' of undefined
    By JCFMachado in forum Ext: Discussion
    Replies: 1
    Last Post: 16 Jun 2011, 3:06 AM

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
  •