Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-8290 in 4.2.1.883.
  1. #1
    Ext JS Premium Member GustavR's Avatar
    Join Date
    Jun 2009
    Posts
    37
    Vote Rating
    18
    GustavR will become famous soon enough

      3  

    Default [4.2.0.265] Ext.util.AbstractMixedCollection: getRange() with start > length

    [4.2.0.265] Ext.util.AbstractMixedCollection: getRange() with start > length


    REQUIRED INFORMATION
    Ext version tested:
    • Ext 4.2.0.265
    Description:
    • When using getRange(start, end), with a start greater than the length of the mixed collection, weird array is returned.
    Steps to reproduce the problem:
    • Create Ext.util.AbstractMixedCollection
    • Add some items (<5)
    • Call getRange(10, 15)
    The result that was expected:
    • An empty Array, because there are no items in given range
    The result that occurs instead:
    • An Array with five items, all undefined but the last one, thats actually the last item of the collection
    Test Case:
    Code:
    c = Ext.create('Ext.util.AbstractMixedCollection');
    
    c.addAll([{
        foo: 1
    },{
        foo: 2
    },{
        foo: 3
    }]);
    
    c.getRange(4, 5); // [undefined, undefined, {foo: 3}]


    HELPFUL INFORMATION

    Possible fix:
    Code:
    Ext.define('Ext.fix.util.AbstractMixedCollection', {
        override: 'Ext.util.AbstractMixedCollection',
        
        getRange: function(start, end) {
            if (start > this.length) {
                return [];
            }
            
            return this.callOverridden(arguments);
        }
    });
    This cost me some time to find and may help someone out there.
    In my case this affected Ext.grid.plugin.BufferedRenderer in a bad way, when scrolled way down in a grid with many rows and then calling store.load() that returned only a few records "internalId of undefined" error was thrown. But unfortunately it was thrown inside of eval'd code so I had no chance finding out what was actually happening (no line number, no file, no stack trace).
    Using the above fix also solves this problem!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    6
    Vote Rating
    1
    dagardner is on a distinguished road

      0  

    Default


    This bug also occurs in 4.1.1

    Code:
    >>> c = Ext.create('Ext.util.AbstractMixedCollection');
    Object { items=[0],  map={...},  keys=[0],  more...}
    
    >>> c.addAll([{     foo: 1 },{     foo: 2 },{     foo: 3 }]);
    undefined
    >>> c.getRange(4, 5);
    [undefined, undefined, Object { foo=3}]
    >>> Ext.versions
    Object { core=4.1.1,  extjs=4.1.1}

Thread Participants: 2