开发者

Setting SmartGWT TreeGrid Data From DMI DataSource

开发者 https://www.devze.com 2023-02-14 10:16 出处:网络
I am getting data back from a SmartGWT DMI datasource but can\'t get that data to show up in a tree. Is there some way to specify what should show in the tree once data is returned?

I am getting data back from a SmartGWT DMI datasource but can't get that data to show up in a tree. Is there some way to specify what should show in the tree once data is returned?

final TreeGrid treeGr开发者_Go百科id = new TreeGrid();
    treeGrid.setWidth(260);
    treeGrid.setHeight(555);
    treeGrid.setShowRoot(true);

    DSRequest req = new DSRequest();
    req.setOperationId("fetchData");
    Map<String, Object> paramMap = new HashMap<String, Object>();
    paramMap.put("param1", "value1");
    paramMap.put("param2", "value2");
    req.setData(paramMap);

    treeGrid.setDataSource(DataSource.get("myDS"));
    treeGrid.fetchData(new Criteria(), new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            treeGrid.setData(response.getData());
        }
    },  req);


I am not familiar with DMI, but if you are using a SmartGwt datasource, it has all the code inbuilt, just attach and fetch. But if you are adding data manually (as seems to be the case with ur code snippet), look at the source code used here - http://www.smartclient.com/smartgwt/showcase/#tree_databinding_local You need to define a TreeNode object etc.

Hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号