http://docs.dojocampus.org/dijit/Tree-examples <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr"> <head> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css" mce_href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css" /> <mce:style type="text/css"><!-- body, html { font-family:helvetica,arial,sans-serif; font-size:90%; } --></mce:style><style type="text/css" mce_bogus="1"> body, html { font-family:helvetica,arial,sans-serif; font-size:90%; } </style> </head> <body class=" claro "> <div dojoType="dojo.data.ItemFileReadStore" jsId="continentStore" url="/moin_static185/js/dojo/trunk/dojo/../dijit/tests/_data/countries.json"> </div> <div dojoType="dijit.tree.ForestStoreModel" jsId="continentModel" store="continentStore" query="{type:'continent'}" rootId="continentRoot" rootLabel="Continents" childrenAttrs="children"> </div> <div dojoType="dijit.Tree" id="mytree" model="continentModel" openOnClick="false"> <mce:script type="dojo/method" event="onClick" args="item"><!-- alert("Execute of node " + continentStore.getLabel(item) + ", population=" + continentStore.getValue(item, "population")); // --></mce:script> </div> </body> <mce:script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" mce_src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" djConfig="parseOnLoad: true"><!-- // --></mce:script> <mce:script type="text/javascript"><!-- dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dijit.Tree"); // --></mce:script> <!-- NOTE: the following script tag is not intended for usage in real world!! it is part of the CodeGlass and you should just remove it when you use the code --> <mce:script type="text/javascript"><!-- dojo.addOnLoad(function() { if (document.pub) { document.pub(); } }); // --></mce:script> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr"> <head> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css" mce_href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css" /> <mce:style type="text/css"><!-- body, html { font-family:helvetica,arial,sans-serif; font-size:90%; } --></mce:style><style type="text/css" mce_bogus="1"> body, html { font-family:helvetica,arial,sans-serif; font-size:90%; } </style> </head> <body class=" claro "> <div dojoType="dojo.data.ItemFileReadStore" jsId="continentStore" url="/moin_static185/js/dojo/trunk/dojo/../dijit/tests/_data/countries.json"> </div> <div dojoType="dijit.tree.ForestStoreModel" jsId="continentModel" store="continentStore" query="{type:'continent'}" rootId="continentRoot" rootLabel="Continents" childrenAttrs="children"> </div> <div dojoType="dijit.Tree" id="mytree" model="continentModel" openOnClick="false"> <mce:script type="dojo/method" event="onClick" args="item"><!-- alert("Execute of node " + continentStore.getLabel(item) + ", population=" + continentStore.getValue(item, "population")); // --></mce:script> </div> </body> <mce:script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" mce_src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" djConfig="parseOnLoad: true"><!-- // --></mce:script> <mce:script type="text/javascript"><!-- dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dijit.Tree"); // --></mce:script> <!-- NOTE: the following script tag is not intended for usage in real world!! it is part of the CodeGlass and you should just remove it when you use the code --> <mce:script type="text/javascript"><!-- dojo.addOnLoad(function() { if (document.pub) { document.pub(); } }); // --></mce:script> </html> Json 文件: http://docs.dojocampus.org/moin_static185/js/dojo/trunk/dijit/tests/_data/countries.json