Pergunta

I am trying to load dynatree using a json object via ajax. I dont have control over the json names and values inside the object. They will be in the format below. I have not been able to get the tree to load. Is there a specific format the json needs to be in, in order to load properly?

Here is the JSON

{
   "root":true,
   "topNode": {
      "containerId":"1",
      "children":[
         {
            "containerId":"2",
            "children":[

            ],
            "root":false
         },
         {
            "containerId":"3",
            "children":[
               {
                  "containerId":"4",
                  "children":[

                  ],
                  "root":false
               }
            ],
            "root":false
         },
         {
            "containerId":"5",
            "children":[
               {
                  "containerId":"6",
                  "children":[

                  ],
                  "root":false
               },
               {
                  "containerId":"7",
                  "children":[

                  ],
                  "root":false
               }
            ],
            "root":false
         } 
      ],
      "root":true
   }
}

Here is the Javascript:

      $(function(){
        $("#treeView").dynatree({
              initAjax: {
                  url: "/myURL",
                  },
        });
      });

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top