Triggering TreeGrid.filterData() on a databound tree I get a com.google.gwt.core.client.JavaScriptException: (TypeError): _1 is undefined error message.
Doing the same on a ListGrid works.
Disabling keepParentsOnFilter seems to fix the problem, but when I try to expand the last child node (actually a leaf) all rows are discarded. Enabling loadDataOnDemand rows are kept.
So I have no way to filter a tree keeping the path to the root.
[ATTACH]4782[/ATTACH] is a complete test case entry point.
I've tested it on SmartGWT 3.1 [SmartClient Version: v8.3_2012-11-20/LGPL Development Only (built 2012-11-20)]
Doing the same on a ListGrid works.
Code:
... {//datasource fields initialization final DataSourceTextField keyField = new DataSourceTextField ("id", "ID"); keyField.setPrimaryKey (true); final DataSourceFloatField parentIdField = new DataSourceFloatField ("parentId", "Parent ID"); parentIdField.setForeignKey ("id"); final DataSourceFloatField nameField = new DataSourceFloatField ("name", "Name"); dataSource.setFields (keyField, parentIdField, nameField); } //UI initialization final TreeGrid treeGrid = new TreeGrid (); treeGrid.setAutoFetchData (true); treeGrid.setKeepParentsOnFilter (true); treeGrid.setDataSource (dataSource); //treeGrid.setLoadDataOnDemand (false); { final DynamicForm form = new DynamicForm(); final TextItem searchItem = new TextItem(); searchItem.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(final KeyPressEvent event) { if ("Enter".equals(event.getKeyName())) { // treeGrid.invalidateCache(); treeGrid.filterData(new AdvancedCriteria("name", OperatorId.ICONTAINS, searchItem.getValueAsString())); } } }); searchItem.setTitle("Search"); form.setItems(searchItem); } ...
So I have no way to filter a tree keeping the path to the root.
[ATTACH]4782[/ATTACH] is a complete test case entry point.
I've tested it on SmartGWT 3.1 [SmartClient Version: v8.3_2012-11-20/LGPL Development Only (built 2012-11-20)]
Comment