Quantcast

Example of json for dijit.Tree?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Example of json for dijit.Tree?

thomaschx
This post has NOT been accepted by the mailing list yet.
Hi,
I'm looking for an Example for my very simple Test using the dijit.Tree.


My html:
[...]
            dojo.require("dojo.data.ItemFileReadStore");
            dojo.require("dijit.Tree");
[...]
<div dojoType="dojo.data.ItemFileReadStore" jsId="layerStore" url="Layers.json"></div>
<div dojoType="dijit.tree.ForestStoreModel" jsId="layerModel" store="layerStore"
  query="{type:'directory'}" rootId="layerRoot" rootLabel="Ebenen"
   childrenAttrs="items">
 </div>
        <div dojoType="dijit.Tree" id="mytree" model="layerModel" openOnClick="true" query="{type:'items'}">

        </div>

One of my Tries for the content of Layers.json:
{
    name: 'layerRoot', type: 'directory', items:[
        {name: 'A', type: 'directory', parent: 'StandorteA'},
        {name: 'H', type: 'directory', parent: 'StandorteA'},
        {name: 'S', type: 'directory', parent: 'layerRoot', label:'x'}]
}

While I'm not gettin an Error, the Result is not as expected. :
Ebenen
-undefined
-undefined
-undefined

What's the complete Structure of the .jason file? I don't really understand the thins I read in den Referenceguide.

Thomasch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Example of json for dijit.Tree?

Aaasaasa
you must read more :
json is a unicode text format with pairs of data - name and value
if you don't understand, then see your Layers and that is json.
just sorted text with comma and brace and brackets for array.

I hope that my english is good enough...must exercise :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Example of json for dijit.Tree?

Karl Tiedt
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Example of json for dijit.Tree?

Jared Jurkiewicz
Also here for what JSON is:

http://www.json.org/

Sincerely,
-- Jared Jurkiewicz

On Mon, Oct 24, 2011 at 1:13 PM, Karl Tiedt <[hidden email]> wrote:

> Try looking at the live test files...
> http://archive.dojotoolkit.org/nightly/checkout/dijit/tests/tree/
>
> -Karl Tiedt
> ________________________________________________________
> Dojotoolkit: http://dojotoolkit.org
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Tutorials: http://dojotoolkit.org/documentation
>
> [hidden email]
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...