2013-07-31 46 views
2

我正在使用具有JsonRestStore的dojo 1.6增強網格,如下面的代碼片段所示。我有大約15000條數據記錄。當網格的垂直滾動條被拖動以滾動時,需要很長時間才能在網格中顯示數據。經過一些調試後,我發現滾動的單一行爲向服務器發送4-5 GET請求。Dojo增強網格滾動與JsonRestStore

有沒有更好的方法來解決這個問題,還是有辦法確保只有最後一個GET請求被髮送到服務器?我能夠捕獲onscroll事件,但不知道如何防止發送GET請求。

store = new dojox.data.JsonRestStore({ 
    target:"myurl", 
    idAttribute: 'id', 
    allowNoTrailingSlash: true});  

mygrid = new dojox.grid.EnhancedGrid({ 
    id: 'mygrid', 
    queryOptions: {ignoreCase: true}, 
    sortInfo: '3', 
    store: store, 
    structure: my.grid.structure, 
    selectionMode: "extended", 
    autoHeight: 12, 
    plugins: {indirectSelection: true}, 
    fastScroll: false 
},document.createElement('div')); 
dojo.byId("datagrid").appendChild(mygrid.domNode); 

// start the grid 
mygrid.startup(); 

回答