2013-04-12 19 views
1

在我的dojo dataGrid中,如果我在第一頁中選擇第7行和第8行,例如我移動通過使用分頁功能到第二頁。在第二頁中默認選擇行(在第一頁中選擇的第7行和第8行)。 這裏是我的網格:當我移動到dojo dataGrid的下一頁,行自動被選中(在第一頁中選擇的行)

var grid = new dojox.grid.EnhancedGrid({ 
id: 'linesGrid', 
style: 'width:950px;height:250px;', 
store: store, 
structure: layout, 
rowSelector: '20px', 
plugins: { 
    indirectSelection: {headerSelector:true, width:"40px", styles:"text-align: center;"}, 
    pagination: { 
     pageSizes: ["25", "50", "100", "All"], 
     description: true, 
     sizeSwitch: true, 
     pageStepper: true, 
     gotoButton: true, 
       /*page step to be displayed*/ 
     maxPageStep: 4, 
       /*position of the pagination bar*/ 
     position: "bottom" 
    } 
} 
}, document.createElement('div')); 

回答

0

你需要顯示下一頁之前做yourGrid.selection.deselectAll();

編輯:這裏也討論了這個問題

部分:

not able to call a function on pagination dojo enhancedGrid

+0

我在哪裏添加這一行?因爲,我認爲分頁不會出現在我的控制權裏嗎?我的意思是當我點擊下一頁時,我不知道要添加上面的代碼將執行哪個代碼.... – kumar

+0

當你點擊nextPage時,調用paginator插件的nextPage函數。還有其他一些功能,如firstpage gotopage等。你可以使用「dojo aspect after」來將一個函數連接到另一個函數。你可以使用「dojo方面之後」將我發佈到nextpage函數的行連接起來。 –

+0

網格在訪問商店時會拋出一個事件,也許您可​​以聽取該事件並添加取消選擇行... –

1

設置網格keepSelection:真。這將保持選擇正確的行。

+0

嗨@CptAJ在那裏我必須添加此行。 –

相關問題