PDA

View Full Version : JSON grid with local paging



mhc982
8 Jul 2010, 1:22 PM
Perhaps someone could give me some guidance on local paging. I have a working JSON grid which uses server-side paging. I would like to change it to use local paging, because I don't want to keep running the search on the server to get another chunk of data.

It looks from the Local Paging example like I need to use PagingModelMemoryProxy, but I'm not clear on how to combine that with the other classes I need to use. Currently I'm doing this:


ScriptTagProxy<String> proxy = new ScriptTagProxy<String>(url);

JsonPagingLoadResultReader<PagingLoadResult<ModelData>> reader = new JsonPagingLoadResultReader<PagingLoadResult<ModelData>>(model);

config = new BasePagingLoadConfig ();

loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy, reader);

store = new ListStore<ModelData>(loader);

Would I change JsonPagingLoadResultReader to JsonLoadResultReader? And use a different loader? And what argument do I give the constructor of PagingModelMemoryProxy? -- it seems to want the data passed in. Any help would be greatly appreciated.