0

I have a problem in removing the records.

I have a grid with pages if i select one record in the first page and change the page and try to remove the record it is not working . (Not delete the record).

Whats i have to do? Is a limitation of grid? Is a bug?

Thanks in advanced.

var aRecords = this.getGridV().getSelectionModel().getSelection();


    if (aRecords.length>0) {


                var store = this.getGridStoreStore();


                store.suspendEvents();
                store.remove(aRecords);
                store.resumeEvents();
                store.sync();
                store.load();
  }
alexander
  • 19
  • 1
  • 5

1 Answers1

0

When you use a paged grid, the store is filtered and does not contain the records outside of the current page. Therefore, if you select a row, by the time you change the page, that row is no longer in the store and is no longer selected.

That's not a bug, it is a limitation due to the whole concept. You cannot select a row that is not displayed.

You could use infinite scrolling using BufferedRenderer, this will allow you to select any row, scroll away and keep it selected.

Lorenz Meyer
  • 19,166
  • 22
  • 75
  • 121
  • Thanks, 'buffered: true' withdraws the checkbox in head of grid, BufferedRenderer when select all records and deleted the grid not refresh correctly. Sou difficult to use this component with application rules. Why grid.getView().refresh() not work and store.load() not update correctly the grid? Thank you – alexander Jul 24 '14 at 12:36
  • BufferedRenderer and buffered : true are two very different concepts and I don't think you can use them together. I don't know how you use refresh(). Usually the view updates itself according to the changes in the store. – Lorenz Meyer Jul 24 '14 at 17:01
  • It is not possible to answer the question about store.load() not working. There is so much interaction between the selection, the store and the server going on, that you have to observe yourself and find what exactly is not working like you expect. – Lorenz Meyer Jul 24 '14 at 17:05
  • Very thank you, now it's work's good. I make many errors. If not put the last parameters true '...select(selectedRecords,false,true)' the 'select' is called many records i have in array selectedRecods. The store.load() call proxy to update the page before the delete finish. When i put store.sync({}) work correct and don't need the refresh(). I think now is correct. Thanks – alexander Jul 24 '14 at 22:44