com.extjs.gxt.ui.client.data
Class BaseListLoader<D extends ListLoadResult<?>>

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.data.BaseLoader<D>
          extended by com.extjs.gxt.ui.client.data.BaseListLoader<D>
Type Parameters:
D - the list load result type
All Implemented Interfaces:
ListLoader<D>, Loader<D>, Observable
Direct Known Subclasses:
BasePagingLoader

public class BaseListLoader<D extends ListLoadResult<?>>
extends BaseLoader<D>
implements ListLoader<D>

Default implementation of the ListLoader interface.

Events:
BeforeLoad : LoadEvent(loader, config)
Fires before a load operation. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
Load : LoadEvent(loader, config, result)
Fires after the button is selected.
LoadException : LoadEvent(loader, config, result)
Fires after the button is selected.


Field Summary
 
Fields inherited from class com.extjs.gxt.ui.client.data.BaseLoader
lastConfig, proxy, reader, reuseConfig
 
Fields inherited from interface com.extjs.gxt.ui.client.data.Loader
BeforeLoad, Load, LoadException
 
Constructor Summary
BaseListLoader(DataProxy proxy)
          Creates a new loader instance with the given proxy.
BaseListLoader(DataProxy proxy, DataReader reader)
          Creates a new loader instance.
 
Method Summary
 Style.SortDir getSortDir()
          Returns the current sort direction.
 java.lang.String getSortField()
          Returns the current sort field.
 boolean isRemoteSort()
          Returns true if remote sorting is enabled.
protected  java.lang.Object newLoadConfig()
          Template method to allow custom BaseLoader subclasses to provide their own implementation of LoadConfig
protected  java.lang.Object prepareLoadConfig(java.lang.Object config)
          Template method to allow custom subclasses to prepare the load config prior to loading data
 void setRemoteSort(boolean remoteSort)
          Sets the remote sort state.
 void setSortDir(Style.SortDir sortDir)
          Sets the current sort direction.
 void setSortField(java.lang.String sortField)
          Sets the current sort field.
 void useLoadConfig(java.lang.Object loadConfig)
          Use the specified LoadConfig for all load calls.
 
Methods inherited from class com.extjs.gxt.ui.client.data.BaseLoader
addLoadListener, getLastConfig, getProxy, isReuseLoadConfig, load, load, loadData, loadData, onLoadFailure, onLoadSuccess, removeLoadListener, setReuseLoadConfig
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.extjs.gxt.ui.client.data.Loader
addLoadListener, load, load, removeLoadListener
 
Methods inherited from interface com.extjs.gxt.ui.client.event.Observable
addListener, fireEvent, getListeners, hasListeners, hasListeners, removeAllListeners, removeListener
 

Constructor Detail

BaseListLoader

public BaseListLoader(DataProxy proxy)
Creates a new loader instance with the given proxy. A reader is not specified and will not be passed to the proxy at load time.

Parameters:
proxy - the data proxy

BaseListLoader

public BaseListLoader(DataProxy proxy,
                      DataReader reader)
Creates a new loader instance.

Parameters:
proxy - the data proxy
reader - the data reader
Method Detail

getSortDir

public Style.SortDir getSortDir()
Description copied from interface: ListLoader
Returns the current sort direction.

Specified by:
getSortDir in interface ListLoader<D extends ListLoadResult<?>>
Returns:
the sort direction

getSortField

public java.lang.String getSortField()
Description copied from interface: ListLoader
Returns the current sort field.

Specified by:
getSortField in interface ListLoader<D extends ListLoadResult<?>>
Returns:
the sort field

isRemoteSort

public boolean isRemoteSort()
Description copied from interface: ListLoader
Returns true if remote sorting is enabled.

Specified by:
isRemoteSort in interface ListLoader<D extends ListLoadResult<?>>
Returns:
the remote sort state

setRemoteSort

public void setRemoteSort(boolean remoteSort)
Description copied from interface: ListLoader
Sets the remote sort state.

Specified by:
setRemoteSort in interface ListLoader<D extends ListLoadResult<?>>
Parameters:
remoteSort - true for remote sort, false for local sorting

setSortDir

public void setSortDir(Style.SortDir sortDir)
Description copied from interface: ListLoader
Sets the current sort direction.

Specified by:
setSortDir in interface ListLoader<D extends ListLoadResult<?>>
Parameters:
sortDir - the sort direction

setSortField

public void setSortField(java.lang.String sortField)
Description copied from interface: ListLoader
Sets the current sort field.

Specified by:
setSortField in interface ListLoader<D extends ListLoadResult<?>>
Parameters:
sortField - the sort field

useLoadConfig

public void useLoadConfig(java.lang.Object loadConfig)
Use the specified LoadConfig for all load calls. The BaseLoader.reuseConfig will be set to true.


newLoadConfig

protected java.lang.Object newLoadConfig()
Template method to allow custom BaseLoader subclasses to provide their own implementation of LoadConfig

Overrides:
newLoadConfig in class BaseLoader<D extends ListLoadResult<?>>

prepareLoadConfig

protected java.lang.Object prepareLoadConfig(java.lang.Object config)
Template method to allow custom subclasses to prepare the load config prior to loading data

Overrides:
prepareLoadConfig in class BaseLoader<D extends ListLoadResult<?>>