You found a bug! We've classified it as a bug in our system. We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha - Community Support Team
    Join Date
    Jun 2010
    Posts
    220
    Vote Rating
    0
    meyerovb is on a distinguished road

      0  

    Default [FIXED-212] List not reducing scroll position after reload

    [FIXED-212] List not reducing scroll position after reload


    In the code example below, scroll down in the list, then press the button. The list appears empty, but if you scroll back up you'll see the new element (and subsequently you will not be able to scroll down again). Expected behavior would be for the container to scroll so it's lower limit matches the bottom of the screen (if it still overflows). My workaround is to scroll manually after reloading the data, let me know if there's another workaround for now.

    Code:
    Ext.setup({ onReady: function () {
        var data = [];
        for (var x = 0; x < 100; x++) data[data.length] = { html: x };
        new Ext.List({
            fullscreen: true,
            store: new Ext.data.Store({ fields: ['html'] }),
            tpl: new Ext.XTemplate('<tpl for="."><div class="list-item">{html}</div></tpl>'),
            itemSelector: '.list-item',
            dockedItems: [{ dock: 'top', xtype: 'button', text: 'shorten list',
                handler: function () {
                    this.ownerCt.getStore().loadData([{ html: 'invisible'}]);
                }
            }]
        }).getStore().loadData(data);
    }});

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thanks for the report.

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,263
    Vote Rating
    121
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Fixed in 0.96.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha User
    Join Date
    Mar 2011
    Posts
    1
    Vote Rating
    0
    tothzoli is on a distinguished road

      0  

    Default does't work in v1.1

    does't work in v1.1


    Hello,

    I have same problem. It does't work in sencha 1.1

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    3
    Vote Rating
    0
    openxtiger is on a distinguished road

      0  

    Default


    Code:
    Ext.override(Ext.DataView,{
        refresh: function() {
            if (!this.rendered) {
                return;
            }
    
    
            this.fireEvent('beforerefresh', this);
            var el = this.getTargetEl(),
                records = this.store.getRange();
            el.update('');
            if (records.length < 1) {
                if (!this.deferEmptyText || this.hasSkippedEmptyText) {
                    el.update(this.emptyText);
                }
                this.all.clear();
            } else {
                this.tpl.overwrite(el, this.collectData(records, 0));
                this.all.fill(Ext.query(this.itemSelector, el.dom));
                this.updateIndexes(0);
            }
            this.hasSkippedEmptyText = true;
    
    
            if (this.scroller) {
                this.scroller.scrollTo({x:0, y:0});
            }
    
    
            this.fireEvent('refresh', this);
        }
    });

Similar Threads

  1. [FIXED] List scroll issue
    By kostik83 in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 19 Jul 2010, 9:59 AM
  2. Saving scroll position after store reload (difference in 3.0 and 3.0.3)
    By marcink86 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 17 Nov 2009, 1:59 AM
  3. [OPEN] [FIXED-212][3.0.0] Text not localized
    By hanne in forum Ext 3.x: Bugs
    Replies: 1
    Last Post: 1 Sep 2009, 7:44 AM
  4. Scroll scroll scroooolllll at a fixed position !!!
    By j-mi-jim in forum Community Discussion
    Replies: 0
    Last Post: 12 Feb 2009, 6:49 AM
  5. Setting the scroll state of a form to a fixed position on load
    By kevinmike in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 10 Feb 2009, 12:23 PM

Thread Participants: 4