use of com.extjs.gxt.ui.client.store.TreeStore in project activityinfo by bedatadriven.
the class TargetIndicatorView method createGridAndAddToContainer.
@Override
protected Grid<ModelData> createGridAndAddToContainer(Store store) {
final TreeStore treeStore = (TreeStore) store;
tree = new EditorTreeGrid<ModelData>(treeStore, createColumnModel());
tree.setAutoExpandColumn("name");
tree.setSelectionModel(new ImprovedCellTreeGridSelectionModel<ModelData>());
tree.setClicksToEdit(EditorGrid.ClicksToEdit.ONE);
tree.setLoadMask(true);
tree.setStateId("TargetValueGrid" + db.getId());
tree.setStateful(true);
tree.setIconProvider(new ModelIconProvider<ModelData>() {
@Override
public AbstractImagePrototype getIcon(ModelData model) {
if (model instanceof IsActivityDTO) {
return IconImageBundle.ICONS.activity();
} else if (model instanceof TargetValueDTO) {
return IconImageBundle.ICONS.indicator();
} else if (model instanceof Link) {
return IconImageBundle.ICONS.folder();
} else {
return null;
}
}
});
addBeforeEditListener();
addAfterEditListener();
add(tree, new BorderLayoutData(Style.LayoutRegion.CENTER));
return tree;
}
use of com.extjs.gxt.ui.client.store.TreeStore in project activityinfo by bedatadriven.
the class SiteAdminTreeLoaderTest method load.
@Test
public void load() {
DispatcherStub dispatcher = new DispatcherStub();
dispatcher.setResult(new GetSchema(), DTOs.PEAR.SCHEMA);
dispatcher.setResult(new GetAdminEntities(1), DTOs.PROVINCES);
SiteAdminTreeLoader loader = new SiteAdminTreeLoader(dispatcher, new AdminGroupingModel(1));
new TreeStore<ModelData>(loader);
loader.load();
}
Aggregations