Hello,
we're using:
- SmartClient Version: SC_SNAPSHOT-2012-01-16_v8.2p/LGPL Development Only (built 2012-01-16)
- firefox 9.0.1
and it looks like that tree.setDefaultIsFolder(false) is not work.
When datasource is changed, node is still added like parent and only after refresh is displayed like child.
It works only if we add property some setChildrenProperty e.g tree.setChildrenProperty("isChildren");
Thanx..
Code:
we're using:
- SmartClient Version: SC_SNAPSHOT-2012-01-16_v8.2p/LGPL Development Only (built 2012-01-16)
- firefox 9.0.1
and it looks like that tree.setDefaultIsFolder(false) is not work.
When datasource is changed, node is still added like parent and only after refresh is displayed like child.
It works only if we add property some setChildrenProperty e.g tree.setChildrenProperty("isChildren");
Thanx..
Code:
Code:
protected TreeGrid createProjectTree() { projectTree = new TreeGrid(); final Tree tree = new Tree(); tree.setModelType(TreeModelType.PARENT); tree.setDefaultIsFolder(false); tree.setNameProperty(CampaignProjectDescriptor.NAME); tree.setIdField(CampaignProjectDescriptor.ID); tree.setParentIdField(CampaignProjectDescriptor.PARENT + "." + CampaignProjectDescriptor.ID); tree.setChildrenProperty("isChildren"); projectTree.setDataProperties(tree); projectTree.setWidth(300); projectTree.setShowAllRecords(true); projectTree.setAutoFetchTextMatchStyle(TextMatchStyle.STARTS_WITH); projectTree.setLoadDataOnDemand(false); projectTree.addFetchDataHandler(new FetchDataHandler() { @Override public void onFilterData(FetchDataEvent event) { DSRequest requestProperties = event.getRequestProperties(); requestProperties.setAttribute (set some atributes ); } }); DomainClassDataSource dataSource = dataSourceFactory.getDataSource(CampaignProjectDescriptor.CLASS_NAME); dataSource.getField(tree.getParentIdField()).setForeignKey(CampaignProjectDescriptor.ID); projectTree.setDataSource(dataSource); TreeGridField treeGridField = new TreeGridField(CampaignProjectDescriptor.NAME, MSG.messages.name()); treeGridField.setCanFilter(true); treeGridField.setFilterOperator(OperatorId.ICONTAINS); projectTree.setFields(treeGridField); projectTree.setAutoFetchData(true); projectTree.setShowFilterEditor(true); projectTree.setHeaderAutoFitEvent(AutoFitEvent.NONE); projectTree.setCanAutoFitFields(false); projectTree.setCanResizeFields(false); return projectTree; }
Comment