[Dojo-interest] Error populating tree

Rob Weiss j105.rob at gmail.com
Mon Jun 21 13:47:13 EDT 2010


You need to use a Tree model....not store... Set the tree model's (or forest
model if you do not have a root) store to your json store, then set the
model of the tree to this tree model.

On Mon, Jun 21, 2010 at 1:33 PM, Harry Devine <lifter89 at comcast.net> wrote:

> I'm trying to populate a tree with items from a json file.  When the
> page renders, Firebug shows an error stating "error loading root
> children", then "missing } after property list".  Here's what the main
> part of my page is:
>
> <body class="soria">
> <div dojoType="dojo.data.ItemFileWriteStore" jsId="playerStore"
> url="folders.json"> </div>
> <div dojoType="dijit.layout.BorderContainer" gutters="true"
> id="borderContainerTwo">
> <div dojoType="dijit.layout.ContentPane" region="top" splitter="false">
>             Test pane
> </div>
> <div dojoType="dijit.layout.BorderContainer" liveSplitters="false"
> design="sidebar"
>             region="center" id="mainSplit">
> <div dojoType="dijit.layout.AccordionContainer" minSize="20"
> style="width: 300px;"
>                 id="leftAccordion" region="leading" splitter="true">
> <div dojoType="dijit.layout.AccordionPane" title="Profile">
> <div dojoType="dijit.Tree" id="playertree" store="playerStore"
> query="{type:'profile'}">
> </div>
> </div>
> <div dojoType="dijit.layout.AccordionPane" title="Picks">
> </div>
> <div dojoType="dijit.layout.AccordionPane" title="Statistics">
> </div>
> </div>
> <!-- end AccordionContainer -->
> <div id="info" dojoType="dijit.layout.ContentPane"region="center">
>                    Test pane #2
> </div>
> </div>
> </div>
> </body>
>
> Here is my JSON file:
> { identifier: 'id',
>   label: 'label'
>   items:[
>     { type: 'profile', id: 'viewprofile', label: 'View/Edit Profile' },
>     { type: 'profile', id: 'chgpwd', label: 'Change Password' }
>   ]
> }
>
> What I'm trying to do is, based on the mail example at
> http://demos.dojotoolkit.org/demos/mail/, create a list of items in a
> tree, then later be able to click on them and do some operation in the
> right hand pane (show database values, etc.).  Anyone have any ideas on
> what could be causing this error?  I'm using Dojo 1.4.3 BTW.
>
> Thanks,
> Harry
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://docs.dojocampus.org
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20100621/f9ef03fe/attachment.htm 


More information about the Dojo-interest mailing list