View Full Version : Get ListStore from a local paging Grid

30 Mar 2013, 12:03 AM

I have a problem with getting the list of all items of my editable local paging grid (After edit, of course). When i type:

Only return the items that are shown on the current page of the grid. I need to get all the item at all the pages. (i dont know if i can get all complete list or i have to get one page-list at a time)
I am using this to implements the paging:

List<Facultad> res = new ArrayList<Facultad>();
PagingModelMemoryProxy proxy = new PagingModelMemoryProxy(res);
PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy);
ListStore<Facultad> listStore= new ListStore<Facultad>(loader);
PagingToolBar toolBar = new PagingToolBar(10);
//"resultado" is the list that i get from a RPC call to reload the grid
public void reloadGrid(List<Facultad> resultado) {
proxy = new PagingModelMemoryProxy(resultado);
loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy);
listStore= new ListStore<Facultad>(loader);

loader.load(0, 10);

grid.reconfigure(listStore, cm);

Thanks for your time! :)

Colin Alworth
1 Apr 2013, 12:14 PM
Paging allows the client to not need to download or display every single possible item. This means the database call can be faster - it only needs to read out some, not all items, the download can be faster - it only has to send the current page, the display can be faster - it only draws the current page.

It sounds like you actually want to load *every single item* on to the client, then only display some of them? This means that the database will need load out each object, the client will need to download them and deserialize them, and the browser will have to hold them all in memory, though it won't display them all at once. For any more than (give or take, depends on browser and how big each object is) a few thousand items, this may result in the browser hanging, just in deserializing the items, and may make download times much longer than you want. Is this really what you want?

27 Jun 2013, 11:22 AM
solved the problem with this:

for (int i = 1; i <= toolBar.getTotalPages(); i++) {