- root : {
- text: 'Tree Node',
- expanded : true,
- children : [ {
- text : "detention",
- aa:'bb',
- leaf : true
- }]
- }
- 请问如何让detention这个节点在渲染后处于默认点击状态
答案:
(tree.panel面板).getSelectionModel().select((data.treestore树模型).getNodeById('节点id'),true);
示例代码:
var treeNode = { id: result, text: patternname, leaf: 1, icon: "/WebShare/Framework/images/QueryPattern/pattern.gif" };
thisobj.tree.getRootNode().appendChild(treeNode);
thisobj.tree.getSelectionModel().select(thisobj.tree.store.getNodeById(result),true);