com.extjs.gxt.ui.client.data
Class BaseListLoader<C extends ListLoadConfig,D extends ListLoadResult>

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

public class BaseListLoader<C extends ListLoadConfig,D extends ListLoadResult>
extends BaseLoader<C,D>
implements ListLoader<C>

Default implementation of the ListLoader interface.

Events:
BeforeLoad : LoadEvent(loader, config)
Fires before a load operation. Listeners can set the doit field to false to cancel the action.
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 interface com.extjs.gxt.ui.client.data.Loader
BeforeLoad, Load, LoadException
 
Constructor Summary
BaseListLoader(DataProxy<C,D> proxy)
          Creates a new loader instance with the given proxy.
BaseListLoader(DataProxy<C,D> proxy, DataReader<C,D> 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.
 void setRemoteSort(boolean remoteSort)
          Sets the remote sort state.
 void setSortDir(Style.SortDir sortDir)
          Sets the current sort dir.
 void setSortField(java.lang.String sortField)
          Sets the current sort field.
 void useLoadConfig(C loadConfig)
          Use the specified LoadConfig for all load calls.
 
Methods inherited from class com.extjs.gxt.ui.client.data.BaseLoader
addLoadListener, getProxy, isReuseLoadConfig, load, load, removeLoadListener, setReuseLoadConfig
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, fireEvent, fireEvent, getFiresEvents, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
equals, 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, removeAllListeners, removeListener
 

Constructor Detail

BaseListLoader

public BaseListLoader(DataProxy<C,D> 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<C,D> proxy,
                      DataReader<C,D> 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<C extends ListLoadConfig>
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<C extends ListLoadConfig>
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<C extends ListLoadConfig>
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<C extends ListLoadConfig>
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 dir.

Specified by:
setSortDir in interface ListLoader<C extends ListLoadConfig>
Parameters:
sortDir - the sort dir

setSortField

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

Specified by:
setSortField in interface ListLoader<C extends ListLoadConfig>
Parameters:
sortField - the sort field

useLoadConfig

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