com.extjs.gxt.ui.client.widget.grid.filters
Class AbstractGridFilters

java.lang.Object
  extended by com.extjs.gxt.ui.client.widget.grid.filters.AbstractGridFilters
All Implemented Interfaces:
ComponentPlugin
Direct Known Subclasses:
GridFilters, TreeGridFilters

public abstract class AbstractGridFilters
extends java.lang.Object
implements ComponentPlugin


Nested Class Summary
static class AbstractGridFilters.GridFiltersMessages
           
 
Field Summary
protected  Grid<ModelData> grid
           
 
Constructor Summary
AbstractGridFilters()
           
 
Method Summary
 void addFilter(Filter filter)
          Adds the given filter.
protected  void bindStore(Store<ModelData> store)
           
 java.util.List<FilterConfig> buildQuery(java.util.List<Filter> filters)
          Function to take the active filters data and build it into a query.
 void cleanParams(FilterPagingLoadConfig config)
          Removes filter related query parameters from the provided object.
 void clearFilters()
          Turns all filters off.
 Filter getFilter(java.lang.String dataIndex)
           
 java.util.List<Filter> getFilterData()
          Returns a list of the currently active filters.
protected abstract  Loader<?> getLoader(Store<ModelData> store)
           
protected  Filter getMenuFilter(MenuEvent me)
           
 AbstractGridFilters.GridFiltersMessages getMessages()
           
protected  StoreFilter<ModelData> getModelFilter()
           
protected abstract  Store<ModelData> getStore()
           
 int getUpdateBuffer()
          Returns the number of milliseconds to defer store updates.
 void init(Component component)
          Initializes the plugin when the component is created.
 boolean isAutoReload()
          Returns true if auto load is enabled.
protected  boolean isLocal()
          Returns true if local filtering is enabled.
protected  void onBeforeCheck(MenuEvent me)
           
protected  void onBeforeLoad(LoadEvent le)
           
protected  void onCheckChange(MenuEvent me)
           
protected  void onContextMenu(GridEvent<?> be)
           
protected  void onLoad(LoadEvent le)
           
protected  void onReconfigure()
           
protected  void onStateChange(Filter filter)
           
protected  void reload()
           
 void removeAll()
          Removes all filters.
 void removeFilter(Filter filter)
          Removes the given filter.
 void setAutoReload(boolean autoLoad)
          Tree to reload the datasource when a filter change happens (defaults to true).
protected  void setLocal(boolean local)
          True to use Store filter functions (local filtering) instead of the default server side filtering (defaults to false).
 void setMessages(AbstractGridFilters.GridFiltersMessages messages)
           
 void setUpdateBuffer(int updateBuffer)
          Number of milliseconds to defer store updates since the last filter change (defaults to 500).
 void updateColumnHeadings()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grid

protected Grid<ModelData> grid
Constructor Detail

AbstractGridFilters

public AbstractGridFilters()
Method Detail

addFilter

public void addFilter(Filter filter)
Adds the given filter.

Parameters:
filter - the filter to be added

buildQuery

public java.util.List<FilterConfig> buildQuery(java.util.List<Filter> filters)
Function to take the active filters data and build it into a query.

Parameters:
filters - the active filters
Returns:
the list of filter configs

cleanParams

public void cleanParams(FilterPagingLoadConfig config)
Removes filter related query parameters from the provided object.

Parameters:
config - the load config

clearFilters

public void clearFilters()
Turns all filters off. This does not clear the configuration information (see removeAll()).


getFilter

public Filter getFilter(java.lang.String dataIndex)

getFilterData

public java.util.List<Filter> getFilterData()
Returns a list of the currently active filters.

Returns:
the list of active filters

getMessages

public AbstractGridFilters.GridFiltersMessages getMessages()

getUpdateBuffer

public int getUpdateBuffer()
Returns the number of milliseconds to defer store updates.

Returns:
the update buffer

init

public void init(Component component)
Description copied from interface: ComponentPlugin
Initializes the plugin when the component is created.

Specified by:
init in interface ComponentPlugin
Parameters:
component - the source component

isAutoReload

public boolean isAutoReload()
Returns true if auto load is enabled.

Returns:
the auto load state

removeAll

public void removeAll()
Removes all filters.


removeFilter

public void removeFilter(Filter filter)
Removes the given filter.

Parameters:
filter - the filter to be removed

setAutoReload

public void setAutoReload(boolean autoLoad)
Tree to reload the datasource when a filter change happens (defaults to true). Set this to false to prevent the datastore from being reloaded if there are changes to the filters.

Parameters:
autoLoad - true to enable auto reload

setMessages

public void setMessages(AbstractGridFilters.GridFiltersMessages messages)

setUpdateBuffer

public void setUpdateBuffer(int updateBuffer)
Number of milliseconds to defer store updates since the last filter change (defaults to 500).

Parameters:
updateBuffer - the buffer in milliseconds

updateColumnHeadings

public void updateColumnHeadings()

bindStore

protected void bindStore(Store<ModelData> store)

getLoader

protected abstract Loader<?> getLoader(Store<ModelData> store)

getMenuFilter

protected Filter getMenuFilter(MenuEvent me)

getModelFilter

protected StoreFilter<ModelData> getModelFilter()

getStore

protected abstract Store<ModelData> getStore()

isLocal

protected boolean isLocal()
Returns true if local filtering is enabled.

Returns:
true for local

onBeforeCheck

protected void onBeforeCheck(MenuEvent me)

onBeforeLoad

protected void onBeforeLoad(LoadEvent le)

onCheckChange

protected void onCheckChange(MenuEvent me)

onContextMenu

protected void onContextMenu(GridEvent<?> be)

onLoad

protected void onLoad(LoadEvent le)

onReconfigure

protected void onReconfigure()

onStateChange

protected void onStateChange(Filter filter)

reload

protected void reload()

setLocal

protected void setLocal(boolean local)
True to use Store filter functions (local filtering) instead of the default server side filtering (defaults to false).

Parameters:
local - true for local