dijit tree and focus node

Posted by user220836 on Stack Overflow See other posts from Stack Overflow or by user220836
Published on 2010-01-23T23:37:58Z Indexed on 2010/04/17 14:23 UTC
Read the original article Hit count: 883

Filed under:
|
|

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>

© Stack Overflow or respective owner

Related posts about dijit

Related posts about tree