ExtJS the node code of the dynamic selection tree
Call the place where you need to dynamically select
EXT.GETCMP ("Tree"). Getrootnode (). reload ();
Note: Checkedusers is a global variable that holds the value of the dynamic Node ID.
var deptuserdata = [];
<s:if test= "Deptuserdata!=null" >
Deptuserdata=<s:property value= "Deptuserdata"/>;
</s:if>
Contributor Tree
var tree = new Ext.tree.treepanel ({
ID: ' Tree ',
onlyleafcheckable:true,//only to leaf node optional
Animate:false,//animation effect
Rootvisible:false,
Autoscroll:true,
Disabled:false,
width:620,
HEIGHT:300,
Frame:true,
Border:true,//Border
Lines:true,
Checkmodel: ' Single ',
Loader:new Ext.tree.treeloader ({
Baseattrs: {
Uiprovider:ext.ux.treechecknodeui
}
}),
Renderto: ' Assigntree ',
Root:deptuserdata
});
Tree.getrootnode (). On (' Load ', function (RootNode) {
Rootnode.expand ();
for (var i = 0;i < checkedusers.length;i++) {
Tree.getnodebyid (Checkedusers[i]). Getui (). Checkbox.checked=true;
}
});