Success! Looks like we've fixed this one. According to our records the fix was applied for a bug in our system in a recent build.
  1. #1
    Sencha Premium Member
    Join Date
    Apr 2010
    Location
    Wellington, New Zealand
    Posts
    123
    Vote Rating
    5
    zerkms is on a distinguished road

      1  

    Default Store::sort() method may be improved a bit

    Store::sort() method may be improved a bit


    The extjs version I'm talking about is 4.1.2a

    Currently the sort method of Extjs.data.Store looks like

    Code:
        sort: function() {
            var me = this,
                prefetchData = me.pageMap;
    
    
            if (me.buffered) {
                if (me.remoteSort) {
                    prefetchData.clear();
                    me.callParent(arguments);
                } else {
                    me.callParent(arguments);
                }
            } else {
                me.callParent(arguments);
            }
        },
    it can be reduced to something a bit more readable and short:

    Code:
        sort: function() {
            var me = this,
                prefetchData = me.pageMap;
    
    
            if (me.buffered && me.remoteSort) {
                prefetchData.clear();
            }
            
            me.callParent(arguments);
        },

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,941
    Vote Rating
    635
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Not really a bug, but yeah, that code certainly isn't great. Will fix it up, cheers.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,329
    Vote Rating
    118
    LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all

      0  

    Default


    Store.sort inherits form AbstractStore, but AbstractStore doesn't have the sort method, so why are we calling callParent?

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,941
    Vote Rating
    635
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    It does, it's mixed in by sortable.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,329
    Vote Rating
    118
    LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all

      0  

    Default


    Quote Originally Posted by evant View Post
    It does, it's mixed in by sortable.
    I see, good point.

    But, sortable.sort returns sorters, so we should probably call:

    return me.callParent(arguments);

Thread Participants: 2