Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Stop scrolling to top when grid store is reloaded

  1. #11
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890
    Vote Rating
    90
      0  

    Default

    <span style='krusty'>Oyyyyy</span>

    http://extjs.com/learn/Ext_FAQ#Maint..._Store_reloads

  2. #12
    Sencha - Support Team keckeroo's Avatar
    Join Date
    Mar 2008
    Location
    Winnipeg, Canada
    Posts
    387
    Vote Rating
    12
      0  

    Default

    oyyyyyyy - crap! And i went through those too! Do I feel sheepish or what ? Baaaaaa

    At least I learned much in the process

    Thanks to all ..

  3. #13
    Sencha - Support Team keckeroo's Avatar
    Join Date
    Mar 2008
    Location
    Winnipeg, Canada
    Posts
    387
    Vote Rating
    12
      0  

    Default

    May I humbly suggest this change / modification to your FAQ page ? :-) I managed to find a way to FREEZE the scrolling even when the number of rows in the grid changes ... just a slight modification and you now get a perfect 'no movement' grid when the store is reloaded regardless of the number of data records added or removed :-)

    Code:
    onLoad: Ext.emptyFn,
    listeners: {
        beforerefresh: function(v) {
           v.scrollTop = v.scroller.dom.scrollTop;
           v.scrollHeight = v.scroller.dom.scrollHeight;
        },
        refresh: function(v) {
           v.scroller.dom.scrollTop = v.scrollTop + (v.scrollTop == 0 ? 0 : v.scroller.dom.scrollHeight - v.scrollHeight);
        }
    },
    I hope this helps some other people :-) It's nice to be able to give something back

    Thanks again

    Kev

  4. #14
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890
    Vote Rating
    90
      0  

    Default

    Hey, if it works, then by all means update the FAQ. I think it's publicly writable, so if you find better ways of doing things, then go for it.

  5. #15
    Sencha Premium User
    Join Date
    Mar 2016
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Hey Kev,

    Could please post the whole grid code ? The beforerefresh/refresh methods does not seem to call

Page 2 of 2 FirstFirst 12

Posting Permissions

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