PDA

View Full Version : Paging GXT



jej2003
10 Sep 2009, 5:11 AM
First off sorry for posting to the incorrect forum before.

@http://www.extjs.com/forum/showthread.php?p=384855#post384855 (http://www.extjs.com/forum/showthread.php?p=384855#post384855)

I have made some headway but I think there is a bit of a disconnect with something I am doing. I am stepping through the code and looking at the BasePagingLoader the offset returned from result.getOffset() is always 0, digging into the XmlReader (where result actually gets created) the offset value never actually gets set (same is true for the other Readers I looked at as well). Am I correct in that the Readers are broken or am I missing something?

jej2003
10 Sep 2009, 6:03 AM
modifying XmlLoadResultReader to set the offset from the loadConfig object seems to have worked, being a GXT new comer though I am nto sure this is how it should be done. Can anyone confirm/prove otherwise that this is a bug?


@Override
protected Object createReturnData(Object loadConfig, List<ModelData> records, int totalCount) {
ListLoadResult<?> result = newLoadResult(loadConfig, records);
if (result instanceof PagingLoadResult) {
PagingLoadResult<?> r = (PagingLoadResult<?>) result;
r.setTotalLength(totalCount);
r.setOffset(((PagingLoadConfig)loadConfig).getOffset());
}
return result;
}