1

In my dojo dataGrid if i select 7th and 8th rows for example in the first page and if i move to second page by using pagination feature. The rows(7th and 8th row which are selected in first page) are selected by default in the second page also. Here is my grid:

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'));
kumar
  • 708
  • 4
  • 15
  • 39

2 Answers2

1

Set the grid to keepSelection : true. This will maintain the proper rows selected.

CptAJ
  • 1,156
  • 1
  • 13
  • 20
0

You need to do a yourGrid.selection.deselectAll(); before showing the next page.

EDIT:

Part of this question was also discussed here:

not able to call a function on pagination dojo enhancedGrid

Community
  • 1
  • 1
Lucian Depold
  • 1,999
  • 2
  • 14
  • 25
  • where i have to add this line? Because,i think the pagination will not be there in my control right? I mean when i click on next page,i don't know which code will be executed for adding the above code.... – kumar Apr 12 '13 at 13:54
  • When you click on nextPage the function nextPage of the paginator plugin is called. There also other functions like firstpage gotopage etc. You can use "dojo aspect after" to hook up a function to another function. You could hook up the line i posted to the nextpage function using "dojo aspect after". – Lucian Depold Apr 12 '13 at 14:21
  • The grid throws an event when it accesses the store, maybe you could listen for that event and add the deselectall line... – Lucian Depold Apr 12 '13 at 14:23
  • I searched all over net.I didnt get the event,which will be called on pagination, I tried with below code but its not wrkng.. grid.on("SetStore", function(evt){ alert("store changes"); }, true); – kumar Apr 15 '13 at 08:56