Create and configure Skytree is very easy and even interesting. There are two method for configcuring Skytree,both quickly, in this section,we introduce one of methods, by simply script.
Just do with following steps:
Example: <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" type="text/javascript" src="../Script/SkyTree.js"></script>
<title>Skytree Sample</title>
</head>
<body> <h3>My first Skytree</h3>
<div id="Tree"></div>
<script language="javascript" type="text/javascript">
ST_DEFAULT_BASE_PATH = '../'; // Set root path.
var objTree = new SkyTree('objTree','Tree'); // Create object. objTree.readOnly = true; // A sample configuration, you can add more here to fit your need.
objTree.initialize(); // Initialization. var aNode = objTree.createNode(0); // Create the first node.
aNode.setText('Hello,world!'); // Set node text.
// Other code,such as create nodes.
</script>
</body>
</html>
Save the code above as an HTML file namde 'Hello.html' in a folder named 'MyTree' based on Skytree root folder, then open it in browser :
Of course this tree is very simple, however, that's a tree, and we can make it strong and bloomy. Follow me, and your magical tour is just at the beginning.
Related
topics: