Results 1 to 2 of 2

Thread: Dataview listpaging error - Uncaught TypeError: Cannot read property 'getBox'

    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
    94

    Default Dataview listpaging error - Uncaught TypeError: Cannot read property 'getBox'

    Ext version tested:



    • Ext 6.5.2 - Modern framework
    • CMD 6.5.2.15



    Browser versions tested against:


    • Chrome


    DOCTYPE tested against:


    • HTML5



    Description:

    Create a dataview with listpaging plugin and populate with data.
    causes error...below...

    Steps to reproduce the problem:

    create a dataview - with these plugins and populate with data
    e.g. extend: 'Ext.dataview.DataView',
    config: {
    plugins: {
    pullrefresh: {
    pullText: 'Pull down to refresh',
    docked: 'bottom'
    },
    listpaging: {
    autoPaging: true,
    loadMoreText: 'Loading...',
    noMoreRecordsText: 'No more records'
    }
    }




    The result that was expected:

    No error


    The result that occurs instead:

    ListPaging.js?_dc=1516058631317:327 Uncaught TypeError: Cannot read property 'getBox' of undefined
    at constructor.doEnsureBufferZone (ListPaging.js?_dc=1516058631317:327)
    at constructor.ensureBufferZone (ListPaging.js?_dc=1516058631317:293)
    at constructor.fn (ListPaging.js?_dc=1516058631317:304)
    at ext-modern-all-debug.js?_dc=1516058631318:14074
    at constructor.fire (ext-modern-all-debug.js?_dc=1516058631318:13890)
    at constructor.doFireEvent (ext-modern-all-debug.js?_dc=1516058631318:14600)
    at constructor.doFireEvent (ext-modern-all-debug.js?_dc=1516058631318:32588)
    at constructor.prototype.doFireEvent (ext-modern-all-debug.js?_dc=1516058631318:40578)
    at constructor.fireEventArgs (ext-modern-all-debug.js?_dc=1516058631318:14506)
    at constructor.fireEvent (ext-modern-all-debug.js?_dc=1516058631318:14478)

    Possible fix

    was able to stop this occuring by adding an override for ListPaging with this fix:

    Code:
    doEnsureBufferZone: function() {
                var me = this,
                    list = me.cmp,
                    store = list.getStore(),
                    scroller = list.getScrollable(),
                    count = store && store.getCount(),
                    bufferZone = me.getBufferZone(),
                    item, box, y, index;
    
    
                if (!store || !count || !scroller || me.getLoading()) {
                    return;
                }
    
    
                index = Math.min(Math.max(0, count - bufferZone), count - 1);
                item = list.mapToItem(store.getAt(index));
    
    
                // OLD code
                // box = item && item.element.getBox();
    
    
                // NEW code starts
                if (item.element) {
                    box = item && item.element.getBox();
                } else {
                    if (item.el) {
                        box = item && item.el.getBox();
                    } else {
                        return;
                    }
                }
                // NEW Code ends
                if (!box) {
                    return;
                }
    
    
                // if bufferZone is 0, loading the next page should happen when reaching the end
                // of the list (the bottom of the last item), else, if bufferZone is greater than
                // 0, loading the next page should happen when the first row of pixels of the
                // leading buffer zone item appears in the view.
                y = bufferZone > 0 ? box.top + 1 : box.bottom;
                if (y > scroller.getElement().getBox().bottom) {
                    return;
                }
    
    
                me.loadNextPage();
            },

  2. #2
    Ext Support Team
    Join Date
    Nov 2017
    Posts
    46

    Default

    Hi,

    The main aim of listpaging plugin is to support Ext.dataview.List, not Ext.dataview.DataView.

    Sample fiddle fiddle demonstrating the scenario -
    https://fiddle.sencha.com/#view/editor&fiddle/2c9v

Similar Threads

  1. Uncaught Error: Cannot read property 'object' of undefined TypeError
    By isrubens in forum Sencha Architect 4.x: Bugs
    Replies: 2
    Last Post: 3 Apr 2017, 8:13 AM
  2. Replies: 1
    Last Post: 17 Mar 2014, 12:06 AM
  3. Replies: 5
    Last Post: 17 Oct 2011, 5:17 AM
  4. Ext.DataView : Uncaught TypeError: Cannot read property 'length' of undefined
    By rockinthesixstring in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 23 Jun 2011, 7:25 AM
  5. DataView: Uncaught TypeError: Cannot read property 'items' of undefined
    By msuresh in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 13 Jun 2011, 12:05 PM

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
  •