title: ExtJS 5 - Keep scroll position of grid when datastore reloads
body: <p>Can anyone tell me how I can keep the position of my scroll bar when my datastore reloads? Below is the code I have for the window/grid and refresh code. Everytime refreshActions executes the scroll bar scrolls to the top of the grid:</p>
  
  <p>preserveScrollonRefresh <strong>does not work in this scenario</strong></p>
  
  <p><strong>View</strong></p>
  
  <pre><code>Ext.define('Tool.view.ActionView',{
  extend: 'Ext.window.Window',
  xtype: 'toolactions',
  requires:[
      'Tool.view.ActionController'
      ],
  controller: 'actions',
  viewModel: {},
  layout: { type: 'border' },
  closeAction: 'hide',
  title: 'Actions',
  store: 'Task',
  width: 1500,
  height: 800,    
  items: [{
                  id: 'ChangeLog',
                  xtype: 'grid',
                  selType: 'rowmodel',
                  split: true,
                  title: 'Log',
                  region: 'south',
                  width: 600,
                  height: 300,
                  bind: {store: '{tasks}'},
                  columns: {
                      defaults: {
                      width: 175
                      },
                      items: [
                              { text: 'Script Command', dataIndex: 'command_script', flex: 1},
                              { text: 'Output', dataIndex: 'command_output', width: 250, flex: 1 },
                              { text: 'Status', dataIndex: 'state', width: 250, flex: 1 }]
                      },
  
              bbar: ['-&gt;',{
                             xtype: 'button',
                             text: 'Refresh',
                             listeners: {
                                 click: 'refreshActions'
                             }
                      }
              ]
  
              }]
  </code></pre>
  
  <p><strong>Refresh Code</strong></p>
  
  <pre><code>refreshActions: function() {
      var me = this;
      this.currentRecord.tasks().load(function(records, operation, success) {
          if(!operation.wasSuccessful()) {
              var message = "Failed to load data from server.";
  
              if(operation.hasException())
                  message = message + " " + operation.getError();
  
              var app = Tool.getApplication();
              app.toast(message,'error');
          }
          else { 
              me.configureButtons();
              me.configureAutoRefresh();
          }
      });
  }
  </code></pre>
  
  <p><strong>Detect for Auto Refresh</strong></p>
  
  <pre><code>configureAutoRefresh: function() {
      var autoRefresh = false;
      var maxId = this.getMaximumId(this.currentRecord.tasks());
      var maxRecord = this.currentRecord.tasks().getById(maxId);
  
      if(maxRecord.data.state=='1' || maxRecord.data.state=='0') {
          autoRefresh = true;
      }
  
      if(autoRefresh == true) {
          if(this.autoRefreshTask == null) {
              var me = this;
              var task = 
                      {
                          run: function() {
                              me.refreshActions();
                              return true;
                          },
                          interval: 2000 // 2 seconds
                      };
              this.autoRefreshTask = Ext.TaskManager.start(task);
          }
      }
      else if(this.autoRefreshTask != null) {
          Ext.TaskManager.stop(this.autoRefreshTask);
          this.autoRefreshTask = null;
      }
  }
  </code></pre>