2012-10-18 22 views
1

我試圖設置在我livesearchgridpanel.i'm獲取數據在HTTPPROXY一個pagingtoolbar pagingtoolbar,所以這裏是我的商店:問題與一個livesearchgridpanel

tempStore = new Ext.data.Store 
    ({ 
     groupField  : default_groupby_s, 
     model   : 'reportWorkspace', 
     allowFunctions : true, 
     autoSync  : false, 
     pageSize  : 20, 
     autoLoad  : true, 
     remoteSort  : false, 
     proxy   : new Ext.data.HttpProxy 
     ({ 
      url   : url_s, 
      actionMethods : 
      { 
       read : 'POST' 
      }, 
      reader  : 
      { 
       type   : 'json', 
       root   : 'workspace_report', 
       successProperty : 'success' 
      } 
     }) 
    }); 
return tempStore ; 
} 

,這裏是我的pagingtoolbar,這將包括在我的LivesearchgridPanel:

{ 
    xtype: 'pagingtoolbar', 
    store: tempStore , 
    dock: 'bottom', 
    pageSize:20, 
    displayInfo: true 
} 

的問題,那就是在pagingtoolbar正確顯示頁面,但在我的網格的情況下,它會顯示在同一時間的所有數據(在每一頁)。是否有可能做到這一點,而不需要在autoload參數中設置任何起點或限制? 我只是想下載我的所有數據,然後正確顯示它的頁面

任何建議請?

回答

1

我看到幾個incosistencies:

  1. LiveGrid沒有內置分頁的所有,但作爲替代它。
  2. ExtJS 4.1x不再使用HTTP代理類,而是使用type:'ajax'代理配置。
  3. 如果您要分頁數據,您需要對其進行遠程排序,否則它將無意義。
  4. 您必須確保您的網格面板和您的pagingtoolbar引用同一商店實例。在網格面板中的常見配置是:

this.dockedItems = [ 
     { 
      xtype:'pagingtoolbar', 
      store:this.store, // same store GridPanel is using 
      dock:'bottom', 
      displayInfo:true 
     } 
    ];