Class PagingLoader<C extends PagingLoadConfig,D extends PagingLoadResult<?>>
- java.lang.Object
-
- com.sencha.gxt.data.shared.loader.Loader<C,D>
-
- com.sencha.gxt.data.shared.loader.ListLoader<C,D>
-
- com.sencha.gxt.data.shared.loader.PagingLoader<C,D>
-
- Type Parameters:
C- the type of data for the input objectD- the type of data to be returned by the loader
- All Implemented Interfaces:
BeforeLoadEvent.HasBeforeLoadHandlers<C>,LoaderHandler.HasLoaderHandlers<C,D>,LoadExceptionEvent.HasLoadExceptionHandlers<C>,LoadHandler.HasLoadHandlers<C,D>
public class PagingLoader<C extends PagingLoadConfig,D extends PagingLoadResult<?>> extends ListLoader<C,D>
A ListLoader subclass which adds support for paged data (offset, limit, and total count).
-
-
Constructor Summary
Constructors Constructor Description PagingLoader(DataProxy<C,D> proxy)Creates a new paging loader instance.PagingLoader(DataProxy<C,T> proxy, DataReader<D,T> reader)Creates a new paging loader instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetLimit()Returns the current limit.intgetOffset()Returns the offset of the first record.intgetTotalCount()Returns the total number of models in the dataset as returned by the server.voidload(int offset, int limit)Loads the data using the specified configuration.voidsetLimit(int limit)Sets the limit size.voidsetOffset(int offset)Sets the offset.voiduseLoadConfig(C loadConfig)Use the specified LoadConfig for all load calls,Loader.setReuseLoadConfig(boolean)will be set to true.-
Methods inherited from class com.sencha.gxt.data.shared.loader.ListLoader
addSortInfo, addSortInfo, clearSortInfo, getSortInfo, isRemoteSort, removeSortInfo, setRemoteSort
-
Methods inherited from class com.sencha.gxt.data.shared.loader.Loader
addBeforeLoadHandler, addLoaderHandler, addLoadExceptionHandler, addLoadHandler, getLastLoadConfig, getProxy, isReuseLoadConfig, load, load, setReuseLoadConfig
-
-
-
-
Constructor Detail
-
PagingLoader
public PagingLoader(DataProxy<C,D> proxy)
Creates a new paging loader instance.- Parameters:
proxy- the data proxy
-
PagingLoader
public PagingLoader(DataProxy<C,T> proxy, DataReader<D,T> reader)
Creates a new paging loader instance.- Type Parameters:
T- the type of data being proxied- Parameters:
proxy- the data proxyreader- the data reader
-
-
Method Detail
-
getLimit
public int getLimit()
Returns the current limit.- Returns:
- the current limit
-
getOffset
public int getOffset()
Returns the offset of the first record.- Returns:
- the current offset
-
getTotalCount
public int getTotalCount()
Returns the total number of models in the dataset as returned by the server.- Returns:
- the number of models as passed from the server
-
load
public void load(int offset, int limit)Loads the data using the specified configuration.- Parameters:
offset- the offset of the first record to returnlimit- the page size
-
setLimit
public void setLimit(int limit)
Sets the limit size.- Parameters:
limit- the limit
-
setOffset
public void setOffset(int offset)
Sets the offset.- Parameters:
offset- the offset
-
useLoadConfig
public void useLoadConfig(C loadConfig)
Use the specified LoadConfig for all load calls,Loader.setReuseLoadConfig(boolean)will be set to true.- Overrides:
useLoadConfigin classListLoader<C extends PagingLoadConfig,D extends PagingLoadResult<?>>- Parameters:
loadConfig- the load config
-
-