title: Dojo Tree : bridge from *unformatted* json to expected format
body: <p>I am very new to Dojo (1.7), and I am very excited by the AMD loader and the global philosophy, then thought I have red some dozen of documentation and googled a lot and my brains starts to grill, I am still unable to understand and perform some things : I would like to display a dijit.Tree of <em>any</em> sort of JSON, yes like a JSON editor, because I use also persistent JSON files for storing few datas (not only for GET/.../ transmission) . Here are my expects :</p>
  
  <ul>
  <li>sample JSON : <code>{"infos":{"address":"my address","phone":"my
  phone"},"insurance":{"forks":[14,53,123],"prices":[5,8,"3%"]}}</code></li>
  <li>display the differents variables of any JSON : the root child is the
  root json variable, children L1 are the root variables, etc...and upon the json variable type (String, Number, Object, Array) I will also display a corresponding icon</li>
  <li>not to have to parse the whole json and format it in one big time, would like for exemple to display first the root node, then the well formated children trought a getChildren method for example, so it is done progressively on expando (like a lazy load). I have already made my own Trees classes with javascript, the more flexible way was I gave a dataRoot, a renderItem(dataItem, domItem) and a getChildren(dataItem) to the constructor so I could perform and return all I want, the Tree only performed the rendering  only when needed, the Tree had no knowing about datas structure neither modify it, but I am not sure to understand well why the dijit.Tree needs a so restrictive way of build...</li>
  </ul>
  
  <p>Here is my last try, it might totally not the right way, (maybe I have to subclass) but as far as I understand, I need to play with 3 classes (dojo store, tree model and tree widget), but firstly it seems the model can't get the root node, please check my different code comments. So please is there any patient person that can give me a simple example with some clear explanations (yeah I am a bit demanding), at least the list of the right necessary variables for constructor's options I need for start displaying a nice tree view of my json file, there's so much I'm totally lost, many thanks !</p>
  
  <pre><code>...
  // before there is the AMD part that load the needed things
  Xhr.get({ url:'data/file.json', handleAs:'json',
      load: function(data){
          console.log('xhr.loaded : ', data);// got my javascript object from the json string
          var store = new ItemFileReadStore({// is it the right store I need ??
              // or the Memory store ?
              // assuming later I'll need to save the data changes 
              rootId : 'root',// 
              rootLabel : 'Archive',// useless ? isn't it the model responsability ?
              data : {id:'root', items:[data]}// trying to give a root node well formatted
          });
          var model = new TreeStoreModel({
              store : store,
              getChildren : function(obj){
                  // firstly here it seems the root is not found
                  // I got a 'error loading root' error
                  // what is missing in my instanciations ??
                  // what is exactyly the type of the 1st arg : a store ?
                  console.log('getChildren : ', this.get(obj.id));
              },
              mayHaveChildren : function(){
                  console.log('mayHaveChildren ', arguments);
                  return true;
              }
          });
          var tree = new Tree({
              model: model
          }, domId);
          tree.startup();
      }
  });
  </code></pre>