Results 1 to 6 of 6

Thread: BufferedRenderer refreshSize fails when no items in store (yet)

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    76

    Default BufferedRenderer refreshSize fails when no items in store (yet)

    Running version: 5.1.0.100

    I've found that Ext.grid.plugin.BufferedRenderer.refreshSize can be called when there are no records loaded yet in the grid (this might have been true before also, I don't know). I haven't put much effort into analyzing if I'm the cause of the refresh call or not (call stack doesn't contain my code at least).

    Problem is that the following code fails in this case:

    Line 327-329:
    Code:
    if (view.all.endIndex === (me.store.getCount()) - 1) {
            me.stretchView(view, me.scrollHeight = me.bodyTop + view.body.dom.offsetHeight);
    }
    view.all.endIndex === -1 and me.strore.getCount() === 0 as the view isn't rendered yet view.body.dom will be undefined.

    If you need more details on my grid configuration that triggers this case please request this!

  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 this issue?https://fiddle.sencha.com/#home

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    76

    Default

    I don't think I will be able to create a fiddle that triggers the problem as it shows up only sporadically and in a very large application.

    I assume the best thing would be to avoid coming to the refresh before anything is loaded, but removing the exception would be very helpful.

    Code:
    if (view.body.dom !== undefined && view.all.endIndex === (me.store.getCount()) - 1) {
        me.stretchView(view, me.scrollHeight = me.bodyTop + view.body.dom.offsetHeight);
    }

  4. #4
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    When it does occur, can you capture the stack trace? I tried to reproduce it a few different ways but wasn't able to. Is it possible it's reacting to a store load during a destroy?

  5. #5
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    76

    Default

    Hi,

    Sorry, I should have given more details from start. Here comes a description of the case.

    The error occurs in my report view and only when it is freshly created. A report view is a panel with a label at the top and then a grid panel. The items are fetched from the server using a buffered store. I have traced the case and it is the first call to refreshSize that fails and it seems like it is called before the grid data has loaded. Looking closer at the stack trace I see that it is related to binding. There are no explicit bindings into the grid but I do have a viewmodel (for now just used for storing some data connected to the view), but there are bindings for the label and the wrapping panel.

    After the first refreshSize call there are multiple more calls and all those are ok (there are data available and the view.body is available).

    Here is the stack trace for the failure.
    Code:
    .refreshSize()                 BufferedRenderer.js:328
    .privates.refreshScroll()         Table.js:3044
    .onResize()                 Component.js:4223
    Ext.Base</<.callParent()         Base.js:1255
    .onResize()                 AbstractView.js:937
    .afterComponentLayout()         Component.js:2109
    .notifyOwner()                 Component.js:166
    .callLayout()                 Context.js:352
    .flushLayouts()             Context.js:523
    .runComplete()                 Context.js:1150
    callOverrideParent()             Ext.js:58
    Ext.Base</<.callParent()         Base.js:1255
    .statics.flushLayouts/<.runComplete() Component.js:175
    .run()                     Context.js:1131
    .statics.flushLayouts()         Component.js:183
    .statics.updateLayout()         Component.js:246
    .updateLayout()             Component.js:5381
    .onContentChange()             Layout.js:490
    .updateLayout()             Component.js:5376
    .onShow()                 Component.js:4278
    .show()                 Component.js:5082
    .setVisible()                 Component.js:4987
    .setHidden()                 Component.js:4997
    .privates.onBindNotify()         Bindable.js:707
    .privates.notify()             BaseBinding.js:88
    .privates.react()             Binding.js:205
    .notify()                 Scheduler.js:403
    .onTick()                 Scheduler.js:434
    Ext.Function</ExtFunction.bind/<() Function.js:164
    Ext.Function</ExtFunction.defer/<() Function.js:366
    While trying to figure out where it can fail I created a fiddle to mimic the behavior I have. I can't get it to fail but hopefully it can give you some clues in what scenario it can happen.


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

    Default

    Hi, Is there any more progress on this??


    I am also getting the same exceptions at the same point on Ext JS 5.1.0. This only happens if the store on the grid has not finished loading


    The work around that I have found is to disable buffered rendering on the grid i.e.
    Code:
    bufferedRenderer:false

Posting Permissions

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