|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.event.BaseObservable
com.extjs.gxt.ui.client.store.Store<M>
com.extjs.gxt.ui.client.store.ListStore<M>
public class ListStore<M extends ModelData>
The store class encapsulates a client side cache of ModelData
objects
which provide input data for Components such as the ComboBox
and
ListView
.
BaseEvent.setCancelled(boolean)
. BaseEvent.setCancelled(boolean)
.BaseEvent.setCancelled(boolean)
.BaseEvent.setCancelled(boolean)
.
Field Summary | |
---|---|
protected ListLoadConfig |
config
|
protected ListLoader<ListLoadResult<M>> |
loader
|
Fields inherited from class com.extjs.gxt.ui.client.store.Store |
---|
Add, all, BeforeAdd, BeforeClear, BeforeDataChanged, BeforeRemove, BeforeSort, Clear, DataChanged, Filter, filterBeginsWith, filtered, filterProperty, filters, filtersEnabled, modified, recordMap, Remove, snapshot, Sort, sortInfo, storeSorter, Update |
Constructor Summary | |
---|---|
ListStore()
Creates a new store. |
|
ListStore(ListLoader loader)
Creates a new store. |
Method Summary | |
---|---|
void |
add(java.util.List<? extends M> models)
Adds the models to the store and fires the Add event. |
void |
add(M model)
Adds the model to the store and fires the Add event. |
protected void |
applySort(boolean supressEvent)
|
protected void |
fireStoreEvent(EventType type,
Record.RecordUpdate operation,
Record record)
|
M |
getAt(int index)
Get the model at the specified index. |
int |
getCount()
Gets the number of cached records. |
ListLoadConfig |
getLoadConfig()
Returns the store's last processed load config if available. |
ListLoader<? extends ListLoadResult<M>> |
getLoader()
Returns the store's loader |
java.util.List<M> |
getRange(int start,
int end)
Returns a range of models between specified indices. |
Style.SortDir |
getSortDir()
Returns the current sort direction. |
java.lang.String |
getSortField()
Returns the current sort field. |
SortInfo |
getSortState()
Returns the current sort state of this store. |
int |
indexOf(M model)
Returns the index of the model in this store. |
void |
insert(java.util.List<? extends M> models,
int index)
Inserts the models to the store at the given index and fires the Add event. |
protected void |
insert(java.util.List<? extends M> items,
int index,
boolean supressEvent)
|
void |
insert(M model,
int index)
Inserts the model to the store at the given index and fires the Add event. |
protected void |
onBeforeLoad(LoadEvent le)
|
protected void |
onLoad(LoadEvent le)
|
protected void |
onLoadException(LoadEvent le)
|
void |
remove(int index)
|
void |
remove(M model)
Remove a item from the store and fires the Remove event. |
void |
setDefaultSort(java.lang.String field,
Style.SortDir dir)
Sets the default sort column and order to be used by the next load operation. |
void |
setSortDir(Style.SortDir dir)
Sets the sort direction. |
void |
setSortField(java.lang.String field)
Sets the sort field. |
void |
sort(java.lang.String field,
Style.SortDir sortDir)
Sorts the store. |
protected void |
sortData(java.lang.String field,
Style.SortDir direction)
|
Methods inherited from class com.extjs.gxt.ui.client.store.Store |
---|
addFilter, addStoreListener, afterCommit, afterEdit, afterReject, applyFilters, clearFilters, commitChanges, contains, createStoreEvent, equals, filter, filter, findModel, findModel, findModel, findModels, getFilters, getKeyProvider, getModelComparer, getModels, getModifiedRecords, getRecord, getStoreSorter, hasRecord, isFiltered, isFiltered, isMonitorChanges, onModelChange, registerModel, rejectChanges, removeAll, removeFilter, removeStoreListener, setKeyProvider, setModelComparer, setMonitorChanges, setStoreSorter, swapModelInstance, unregisterModel, update |
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 |
Field Detail |
---|
protected ListLoadConfig config
protected ListLoader<ListLoadResult<M extends ModelData>> loader
Constructor Detail |
---|
public ListStore()
public ListStore(ListLoader loader)
loader
- the loader instanceMethod Detail |
---|
public void add(java.util.List<? extends M> models)
models
- the models to addpublic void add(M model)
model
- the model to addpublic M getAt(int index)
index
- the index of the model to find
public int getCount()
public ListLoadConfig getLoadConfig()
public ListLoader<? extends ListLoadResult<M>> getLoader()
public java.util.List<M> getRange(int start, int end)
start
- the starting indexend
- the ending index
public Style.SortDir getSortDir()
public java.lang.String getSortField()
public SortInfo getSortState()
public int indexOf(M model)
model
- the model
public void insert(java.util.List<? extends M> models, int index)
models
- the models to insertindex
- the insert locationpublic void insert(M model, int index)
model
- the model to insertindex
- the insert locationpublic void remove(int index)
public void remove(M model)
model
- the model to removepublic void setDefaultSort(java.lang.String field, Style.SortDir dir)
field
- the name of the field to sort bydir
- the sort directionpublic void setSortDir(Style.SortDir dir)
dir
- the sort directionpublic void setSortField(java.lang.String field)
field
- the sort fieldpublic void sort(java.lang.String field, Style.SortDir sortDir)
field
- the field to sort bysortDir
- the sort dirprotected void applySort(boolean supressEvent)
applySort
in class Store<M extends ModelData>
protected void fireStoreEvent(EventType type, Record.RecordUpdate operation, Record record)
fireStoreEvent
in class Store<M extends ModelData>
protected void insert(java.util.List<? extends M> items, int index, boolean supressEvent)
protected void onBeforeLoad(LoadEvent le)
protected void onLoad(LoadEvent le)
protected void onLoadException(LoadEvent le)
protected void sortData(java.lang.String field, Style.SortDir direction)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |