|
|||||||||
| 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>
M - the model data typepublic abstract class Store<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
DataView.
| Field Summary | |
|---|---|
static int |
Add
Add event type (value is 1110). |
static int |
BeforeDataChanged
BeforeDataChanged event type (value is 1100). |
static int |
Clear
Clear event type (value is 1140). |
static int |
DataChanged
DataChanged event type (value is 1102). |
static int |
Filter
Filter event type (value is 1105). |
static int |
Remove
Remove event type (value is 1120). |
static int |
Sort
Filter event type (value is 1107). |
static int |
Update
Update event type (value is 1130). |
| Constructor Summary | |
|---|---|
Store()
|
|
| Method Summary | |
|---|---|
void |
addFilter(StoreFilter filter)
Adds a filter to the store. |
void |
addStoreListener(StoreListener listener)
Adds a store listener. |
void |
applyFilters(java.lang.String property)
Applies the current filters to the store. |
void |
clearFilters()
Revert to a view of this store with no filtering applied. |
void |
commitChanges()
Commit all items with outstanding changes. |
boolean |
contains(ModelData item)
Returns true if the item is in this store. |
void |
filter(java.lang.String property)
Filters the store using the given property. |
M |
findModel(M model)
Returns the matching model in the cache using the model comparer to test for equality. |
java.util.List<StoreFilter> |
getFilters()
Returns the store's filters. |
ModelComparer<M> |
getModelComparer()
Returns the comparer used to comapare model instances. |
java.util.List<M> |
getModels()
Returns the store's models. |
java.util.List<Record> |
getModifiedRecords()
Gets all records modified since the last commit. |
Record |
getRecord(M item)
Returns the record instance for the item. |
StoreSorter |
getStoreSorter()
Returns the store sorter. |
boolean |
isFiltered()
Returns true if this store is currently filtered. |
boolean |
isMonitorChanges()
Returns true if the store is monitoring changes. |
void |
rejectChanges()
Cancel outstanding changes on all changed records. |
void |
removeAll()
Remove all items from the store and fires the Clear event. |
void |
removeFilter(StoreFilter filter)
Removes a previously added filter. |
void |
removeStoreListener(StoreListener listener)
Removes a store listener. |
void |
setModelComparer(ModelComparer<M> comparer)
Sets the comparer to be used when comparing model instances. |
void |
setMonitorChanges(boolean monitorChanges)
Sets whether the store should listen to change events on its children (defaults to false). |
void |
setStoreSorter(StoreSorter storeSorter)
Sets the store's sorter. |
void |
update(M model)
Notifies the store that the model has been updated and fires the Update event. |
| 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 |
| Field Detail |
|---|
public static final int BeforeDataChanged
public static final int DataChanged
public static final int Filter
public static final int Sort
public static final int Add
public static final int Remove
public static final int Update
public static final int Clear
| Constructor Detail |
|---|
public Store()
| Method Detail |
|---|
public void addFilter(StoreFilter filter)
filter - the store filter to addpublic void addStoreListener(StoreListener listener)
listener - the listener to addpublic void applyFilters(java.lang.String property)
property - the optional active propertypublic void clearFilters()
public void commitChanges()
Record.RecordUpdate.COMMIT.
public boolean contains(ModelData item)
item - the item
public void filter(java.lang.String property)
property - the property to filter bypublic M findModel(M model)
model - the model
public java.util.List<StoreFilter> getFilters()
public ModelComparer<M> getModelComparer()
public java.util.List<M> getModels()
public java.util.List<Record> getModifiedRecords()
public Record getRecord(M item)
item - the item
public StoreSorter getStoreSorter()
public boolean isFiltered()
public boolean isMonitorChanges()
public void rejectChanges()
public void removeAll()
public void removeFilter(StoreFilter filter)
filter - the filter to removepublic void removeStoreListener(StoreListener listener)
listener - the store listener to removepublic void setModelComparer(ModelComparer<M> comparer)
comparer - the comparerpublic void setMonitorChanges(boolean monitorChanges)
ChangeEventSource may be monitored.
monitorChanges - true to monitor changespublic void setStoreSorter(StoreSorter storeSorter)
storeSorter - the sorterpublic void update(M model)
model - the updated model
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||