2012-08-27 50 views
1

我有一個網格面板,包含大約10列,並且在我的數據存儲中大約有1000條記錄。由於可見記錄的數量少於數據存儲記錄計數,因此我在網格面板中獲得了一個垂直滾動條。當網格顯示在Internet Explorer 9或Google Chrome中時,當使用我的鼠標滾輪時,垂直滾動條移動得很快。但在Mozilla Firefox中,它的滾動速度非常慢。每個完整的手指拉只允許看到一個額外的記錄/行,或更少。Ext.grid.Panel垂直滾動在Mozilla Firefox中極其緩慢

我該如何解決這個問題?

我使用Mozilla Firefox 14.0.1

下午5點21分更新 ..分頁工具欄沒有顯示出來

var store = new Ext.data.Store({ 

     pageSize: 50, 
     // allow the grid to interact with the paging scroller by buffering 
     buffered: true, 
     // never purge any data, we prefetch all up front 
     purgePageCount: 0, 
     model: 'Project', 
     //proxy: { 
     // type: 'memory' 
     //}, 

     proxy: new Ext.ux.AspWebAjaxProxy({ 
      url: '/Controls/ProjectList/ProjectListService.asmx/GetProjectList', 
      actionMethods: { 
       create: 'POST', 
       destroy: 'DELETE', 
       read: 'POST', 
       update: 'POST' 
      }, 
      reader: { 
       type: 'json', 
       model: 'Project', 
       root: 'd' 
      }, 
      headers: { 
       'Content-Type': 'application/json; charset=utf-8' 
      } 
     }), 
     autoLoad: true 
    }); 



Ext.define('Ext.ux.AspWebAjaxProxy', { 
    extend: 'Ext.data.proxy.Ajax', 
    require: 'Ext.data', 

    buildRequest: function (operation) { 
     var params = Ext.applyIf(operation.params || {}, this.extraParams || {}), 
           request; 
     params = Ext.applyIf(params, this.getParams(params, operation)); 
     if (operation.id && !params.id) { 
      params.id = operation.id; 
     } 

     params = Ext.JSON.encode(params); 

     request = Ext.create('Ext.data.Request', { 
      params: params, 
      action: operation.action, 
      records: operation.records, 
      operation: operation, 
      url: operation.url 
     }); 
     request.url = this.buildUrl(request); 
     operation.request = request; 
     return request; 
    } 
}); 

回答

3

要回答你的第一個問題,火狐取得了「平滑滾動」,因爲一個版本的默認配置13 ExtJS的4.1.0並沒有考慮到這一點,但是這是在4.1.1處理。你將不得不升級來處理它,或者你可以將它從4.1.1代碼中分離出來。

看看this

+0

我會盡快進行測試。感謝您的輸入!!非常感激。 – MacGyver

1

有一個在Ext.data.Store這可能有助於緩衝設置。

var store = Ext.create('Ext.data.Store', { 
    id: 'store', 
    pageSize: 50, 
    // allow the grid to interact with the paging scroller by buffering 
    buffered: true, 
    // never purge any data, we prefetch all up front 
    purgePageCount: 0, 
    model: 'ForumThread', 
    proxy: { 
     type: 'memory' 
    } 
}); 

http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/buffer-grid.html

我測試過在Firefox樣品和它比鉻慢了一點,但可用。

如果仍然太慢,可能需要將分頁添加到網格中。

http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/paging.html

+0

它仍然是緩慢的 – MacGyver

+0

緩衝區網格示例代碼也慢嗎? – sissonb

+0

不,示例工作...這是我的代碼...我有一個自定義商店與自定義ASP.NET AJAX代理。我將發佈我的代碼給你...我甚至沒有看到我的網格中的分頁工具欄 – MacGyver