PDA

View Full Version : [CLOSED] [2.0 M3] bug TreeGrid hostmode



Webflash
12 Jun 2009, 5:16 AM
OS Windows, 2.0m3
When select Item throw
[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (TypeError): 'null' - есть null или не является объектом
number: -2146823281
description: 'null' - есть null или не является объектом
at com.google.gwt.dom.client.DOMImplIE6.isOrHasChild(Native Method)
at com.google.gwt.dom.client.Element$.isOrHasChild$(Element.java:365)
at com.google.gwt.user.client.DOM.isOrHasChild(DOM.java:968)
at com.extjs.gxt.ui.client.event.DomEvent.within(DomEvent.java:302)
at com.extjs.gxt.ui.client.widget.treegrid.TreeGrid.onClick(TreeGrid.java:342)
at com.extjs.gxt.ui.client.widget.grid.Grid.onComponentEvent(Grid.java:371)
at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:756)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)


publicvoid onModuleLoad() {

TreeStore<ModelData> store = new TreeStore<ModelData>();

ColumnConfig name = new ColumnConfig("name", "Name", 100);

ColumnModel cm = new ColumnModel(Arrays.asList(name));
TreeGrid<ModelData> tree = new TreeGrid<ModelData>(store, cm);
tree.setBorders(true);
tree.setSize(400, 400);
tree.setAutoExpandColumn("name");
tree.setTrackMouseOver(false);

store.add(generateModelDataList(), false);

Viewport viewPort = new Viewport();
viewPort.setLayout(new FitLayout());
viewPort.add(tree);
RootPanel.get().add(viewPort);

}




protected List<ModelData> generateModelDataList() {
List<ModelData> result = new ArrayList<ModelData>();
for (int i = 0; i < 5; i++) {
ModelData p = new BaseModel();
p.set("name", "product " + i);
result.add(p);
}
return result;
}

sven
12 Jun 2009, 5:22 AM
Thanks for reporting

sven
12 Jun 2009, 5:27 AM
Your code has an issue, one cell (the one that should hold the tree) has to define the treerenderer. Please look at the examples

Webflash
12 Jun 2009, 5:51 AM
thanx