dijit tree and focus node
- by user220836
Hello,
I cannot get focusNode() or expandNode() get working. I also tried switching back to dojo 1.32 and even 1.3, no difference to 1.4. And I debugged with firebug, the node is a valid tree node and no errors occur but the node wont get focused. Help is VERY appreciated!
<head>
<script type="text/javascript">
dojo.declare("itcTree",[dijit.Tree], {
focusNodeX : function(/* string */ id) {
var node=this._itemNodesMap[id];
this.focusNode(node);
}
});
</script>
</head>
<body class="tundra">
<div dojoType="dojo.data.ItemFileReadStore" jsId="continentStore" url="countries.json">
</div>
<div dojoType="dijit.tree.ForestStoreModel" jsId="continentModel" store="continentStore"
query="{type:'continent'}" rootId="continentRoot" rootLabel="Continents"
childrenAttrs="children">
</div>
<div dojoType="itcTree" id="mytree" model="continentModel" openOnClick="true">
<script type="dojo/method" event="onClick" args="item">
dijit.byId('mytree').focusNodeX('AF');
</script>
</div>
<p>
<button onclick="dijit.byId('mytree').focusNode('DE');">klick</button>
</p>
</body>