PDA

View Full Version : How to update paging totalcount when delete row in grid?



ibee133
19 Sep 2007, 11:42 PM
I can't find any method to do this with out refresh or reload ds.

Animal
19 Sep 2007, 11:49 PM
If you are using server-side paging, then Store.getTotalCount is the size of the dataset as determined by the server.

Unless you actually delete a database row, this should not change.

Store.getCount is the number of Records in the current page.

ralf
20 Sep 2007, 12:49 AM
Unless you actually delete a database row, this should not change.


I did delete a row and used the following to update my grid and paging bar:



var id = grid.getSelectionModel().getSelected().id;
var rec = ds.getAt( ds.indexOfId( id ) );
ds.remove(rec);

ds.totalLength-=1; // decrease the totalCount

paging.updateInfo();

Animal
20 Sep 2007, 12:51 AM
You did not delete a row from the database.

The dataset size is still the same. You just removed a Record from the Store.

It's not the same thing.

ibee133
20 Sep 2007, 11:33 PM
I did delete a row and used the following to update my grid and paging bar:



var id = grid.getSelectionModel().getSelected().id;
var rec = ds.getAt( ds.indexOfId( id ) );
ds.remove(rec);

ds.totalLength-=1; // decrease the totalCount

paging.updateInfo();


Thanks it work! I haven't see updateInfo() method in document.