If we have a recordlist (or array of records) that have been retrieved by a manual call to fetchdata from a datasource object, is there an easy way to set a tree or treegrid to those records? (I didn't see any simple setdata method that would work, since the tree.setdata method expects a treenode array, not a recordlist.) I feel that there must be a simple method, since if I directly set a TreeGrid object to this datasource, everything gets automatlly populated, so I should be able to decouple the recordlist from the treegrid and then manually set the treeGrid to the recordlist. (In case you're curious as to why I'm doing this: I want to destroy the treegrid on occasion, but NOT destroy the underlying tree data; but, it seems that if/when I destroy the treegrid, the underlying tree (and data) get lost, if I'm not mistaken. If there were a way to "save" this underlying tree model, then that would be an even better solution....)
Here's the code used to fetch the recordlist or array of records:
Full Infrastucture Details:
==================================
SmartGWT Version: SC_SNAPSHOT-2011-12-05/PowerEdition Deployment (built 2011-12-05)
OS: Windows XP Pro
IDE: MyEclipse 10.0 with Google Plugin for Eclipse (2.5)
Browser: Mozilla Firefox 4.0.1
GWT SDK: 2.4.0
Sun JDK 1.6.0_27
Here's the code used to fetch the recordlist or array of records:
Code:
DataSource x = DataSource.get("dsIAFolderONLY"); DSRequest requestProperties = new DSRequest(); requestProperties.setOperationId("writableFolders"); DSCallback xCallback = new DSCallback() { @Override public void execute(DSResponse response, Object rawData, DSRequest request) { RecordList aa = response.getDataAsRecordList(); } }; x.fetchData(null, xCallback, requestProperties );
==================================
SmartGWT Version: SC_SNAPSHOT-2011-12-05/PowerEdition Deployment (built 2011-12-05)
OS: Windows XP Pro
IDE: MyEclipse 10.0 with Google Plugin for Eclipse (2.5)
Browser: Mozilla Firefox 4.0.1
GWT SDK: 2.4.0
Sun JDK 1.6.0_27
Comment