|
|||||||||
| 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.TreeStore<M>
public class TreeStore<M extends ModelData>
A store for hierarchical data.
The parent child relationshiops are handled internally by the store. It is important to note that the store does not use the the parent and children of any TreeModel instances added to the store. It is important to note the sorting behavior when working with TreeStore. When a sorter is set, it is applied to all existing models in the cache and the Sort event is fired. At this point, the sorter is enabled and active. All sorter will be applied to all inserts into the store. Remote sorting is not supported with TreeStore.
| Field Summary |
|---|
| Fields inherited from class com.extjs.gxt.ui.client.store.Store |
|---|
Add, BeforeDataChanged, Clear, DataChanged, Filter, Remove, Sort, Update |
| Constructor Summary | |
|---|---|
TreeStore()
|
|
TreeStore(TreeLoader loader)
|
|
| Method Summary | |
|---|---|
void |
add(java.util.List<M> models,
boolean addChildren)
Adds the models to the root of the store and fires the Add event. |
void |
add(M item,
boolean addChildren)
Adds the items to the store and fires the Add event. |
void |
add(M parent,
java.util.List<M> children,
boolean addChildren)
Adds the models to the given parent and fires the Add event. |
void |
add(M parent,
M item,
boolean addChildren)
Adds the child to the parent and fires the Add event. |
java.util.List<M> |
getAllItems()
Returns all the stores items. |
M |
getChild(int index)
Returns the root level child. |
M |
getChild(M parent,
int index)
Returns the child at the given index. |
int |
getChildCount()
Returns the root level child count. |
int |
getChildCount(M parent)
Returns the child count for the parent. |
java.util.List<M> |
getChildren(M parent)
Returns the children of the parent. |
TreeLoader |
getLoader()
Returns the store's loader. |
M |
getParent(M item)
Returns the parent of the item. |
java.util.List<M> |
getRootItems()
Returns the root level items. |
void |
insert(java.util.List<M> models,
int index,
boolean addChildren)
Inserts the models into the store and fires the Add event. |
void |
insert(M item,
int index,
boolean addChildren)
Adds the item to the store and fires the Add event. |
void |
insert(M parent,
java.util.List<M> children,
int index,
boolean addChildren)
Inserts the children to the parent and fires the Add event. |
void |
insert(M parent,
M model,
int index,
boolean addChildren)
Adds the child to the parent and fires the Add event. |
void |
remove(M model)
Removes the model from the store and fires the Remove event. |
void |
remove(M parent,
M child)
Removes the child from the parent and fires the Remove event. |
void |
removeAll()
Remove all items from the store and fires the Clear event. |
void |
removeAll(M parent)
Removes all the parent's children. |
void |
setSortInfo(SortInfo info)
Sets the current sort info usen when sorting items in the store. |
void |
setStoreSorter(StoreSorter storeSorter)
Sets the store's sorter. |
| Methods inherited from class com.extjs.gxt.ui.client.store.Store |
|---|
addFilter, addStoreListener, applyFilters, clearFilters, commitChanges, contains, filter, findModel, getFilters, getModelComparer, getModels, getModifiedRecords, getRecord, getStoreSorter, isFiltered, isMonitorChanges, rejectChanges, removeFilter, removeStoreListener, setModelComparer, setMonitorChanges, update |
| 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 |
| Constructor Detail |
|---|
public TreeStore()
public TreeStore(TreeLoader loader)
| Method Detail |
|---|
public void add(java.util.List<M> models,
boolean addChildren)
models - the models to be addedaddChildren - true to recursivly add all children
public void add(M item,
boolean addChildren)
item - the item to addaddChildren - true to recursivly add all children
public void add(M parent,
java.util.List<M> children,
boolean addChildren)
parent - the parentchildren - the childrenaddChildren - true to recursivly add all children
public void add(M parent,
M item,
boolean addChildren)
parent - the parent itemitem - the child itemaddChildren - true to recursivly add all childrenpublic java.util.List<M> getAllItems()
public M getChild(int index)
index - the index
public M getChild(M parent,
int index)
parent - the parent modelindex - the index
public int getChildCount()
public int getChildCount(M parent)
parent - the parent
public java.util.List<M> getChildren(M parent)
parent - the children
public TreeLoader getLoader()
public M getParent(M item)
item - the item
public java.util.List<M> getRootItems()
public void insert(java.util.List<M> models,
int index,
boolean addChildren)
models - the models to insertindex - the insert indexaddChildren - true to recursivly add all children
public void insert(M item,
int index,
boolean addChildren)
item - the item to insertindex - the insert indexaddChildren - true to recursivly add all children
public void insert(M parent,
java.util.List<M> children,
int index,
boolean addChildren)
parent - the parentchildren - the childrenindex - the insert indexaddChildren - true to recursivly add all children
public void insert(M parent,
M model,
int index,
boolean addChildren)
parent - the parent modelmodel - the child modelindex - the insert indexaddChildren - true to recursivly add all childrenpublic void remove(M model)
model - the item to be removed
public void remove(M parent,
M child)
parent - the parent modelchild - the child modelpublic void removeAll()
Store
removeAll in class Store<M extends ModelData>public void removeAll(M parent)
parent - the parentpublic void setSortInfo(SortInfo info)
info - the sort infopublic void setStoreSorter(StoreSorter storeSorter)
Store
setStoreSorter in class Store<M extends ModelData>storeSorter - the sorter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||