[Dojo-interest] Help: dijit.Tree

Daniel daniel.carrera at zmsl.com
Mon Dec 10 17:01:22 UTC 2007


Jon Sykes wrote:
> Groups is already a title pane.
> 
>> <div dojoType="dijit.TitlePane" title="Groups" id='Groups'></div>
> 
> Then you try and make it into a tree.

Oh... I wanted to put the tree *inside* Groups. Ok, now I have:

<div dojoType="dijit.TitlePane" title="Groups">
	<div id='Groups'></div>
</div>

Now I get no error, but the tree is not visible. I added the 'startup' 
command to my dojo.addOnLoad:

var tree = new dijit.Tree({
		store:store,
		labelAttr:'name',
		typeAttr:'type',
		query:{ type: "category" }
	}, dojo.byId("Groups")
);
tree.startup();


But it's still invisible. Using Firebug I can see that the tree widget 
*is* there. But it's invisible. The <div id='Groups'></div> has been 
turned into this:

<div id="Groups" class="dijitTreeContainer" 
dojoattachevent="onclick:_onClick,onkeypress:_onKeyPress" wairole="tree" 
style="" role="wairole:tree" widgetid="Groups">
<div class="dijitTreeNode dijitTreeIsRoot dijitTreeExpandLeaf 
dijitTreeChildrenNo" dojoattachpoint="rowNode" wairole="presentation" 
role="wairole:presentation" style="display: none;">
...
</div>
</div>

But the inner <div> has style="display: none;". I thought that 
tree.startup() should take care of that, but clearly I'm missing 
something else. I also notice that the tree doesn't have the data I gave 
it (e.g. I can't find the word "Fruit" anywhere).

So, clearly I'm missing something else. For those interested, the entire 
markup from Firebug is in the PS.

Is there anything else I must do other than tree.startup()? I don't see 
anything else here:

http://www.dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/manipulating-widgets-through-code/displaying-w

Thanks for all the help.

Cheers,
Daniel.

PS: Markup from Firebug <!-- with comments -->


<!-- This first div looks fine -->

<div id="Groups" class="dijitTreeContainer"
      dojoattachevent="onclick:_onClick,onkeypress:_onKeyPress"
      wairole="tree" style="" role="wairole:tree" widgetid="Groups">


     <!-- This one here has style="display: none;"

     <div class="dijitTreeNode dijitTreeIsRoot dijitTreeExpandLeaf
          dijitTreeChildrenNo" dojoattachpoint="rowNode"
          wairole="presentation" role="wairole:presentation"
          style="display: none;">

         <!-- Don't know what the <span>s are. -->

         <span class="dijitTreeExpando dijitTreeExpandoLoading"
               wairole="presentation" dojoattachpoint="expandoNode"
               role="wairole:presentation"/>

         <span class="dijitExpandoText" wairole="presentation"
               dojoattachpoint="expandoNodeText"
               role="wairole:presentation">*</span>

         <!-- Here I expect to see Fruit/Cinamon/etc but I don't -->

         <div class="dijitTreeContent" wairole="presentation"
              dojoattachpoint="contentNode" role="wairole:presentation">


              <div class="dijitInline dijitTreeIcon undefined"
                   wairole="presentation" dojoattachpoint="iconNode"
                   role="wairole:presentation"/>

             <span class="dijitTreeLabel undefined" tabindex="0"
                   wairole="treeitem" dojoattachpoint="labelNode"
                   role="wairole:treeitem" aaa:expanded="false"/>
         </div>
     </div>
</div>






More information about the Dojo-interest mailing list