dojo Tree 添加、删除节点

                        var tree=this.tree;
                        var store=tree.model.store;
                        if(this.node){
                            console.log(this.node)
                            var children=this.node.getChildren();
                            for(var i=0;i<children.length;i++){
                                store.deleteItem(children[i].item)
                            }
                            var features=_featureset.features;
                            for(var i=0;i<features.length;i++){
                                console.log(features[i].attributes[field])
                                var tdata={type:"feature",label:features[i].attributes[field],name: features[i].attributes[field],id:features[i]["oid"]+"("+i+")"};  
                                 store.newItem(tdata,{parent:node.item, attribute: 'children'});
                            }
                        }
原文地址:https://www.cnblogs.com/Leechg/p/5616721.html