One development environment
Windows 2003
VS 2005
Aptana
Ext2.0
Two client code
HTML: < HTML >
< head >
< meta HTTP-EQUIV = "Content-type" Content = "text/html"; Charset=iso-8859-1 ">
< title > Reorder Treepanel </title >
< link rel = "stylesheet" type = "text/css" href = "resources/css/ext-all.css"/>
<!--GC-->
<!--LIBS-->
< script type = "Text/javascript" src = "adapter/ext/ext-base.js" ></script >
<!--endlibs-->
< script type = "Text/javascript" src = "ext-all.js" ></script >
< script type = "Text/javascript" src = "reorder.js" ></script >
< BODY >
< div id = "Tree-div" style = "overflow:auto;" height:300px;width:250px;border:1px solid #c3daf9; "></div >
</Body >
</HTML >
JS:Ext.onReady (function () ... {
Shorthand
var tree = Ext.tree;
var tree = new Tree.treepanel (...) {
El: ' Tree-div ',
Usearrows:true,
Autoscroll:true,
Animate:true,
Enabledd:true,
Containerscroll:true,
Loader:new Tree.treeloader (.....) {
Dataurl: ' ajax.aspx '
})
});
Set the root node
var root = new Tree.asynctreenode (...). {
Text: ' Head office ',
Draggable:false,
ID: ' Source '
});
Tree.setrootnode (root);
Render the Tree
Tree.render ();
Root.expand ();
} );
Three service-side code
Create a new ajax.aspx page
Using System;
Using System.Data;
Using System.Web;
public partial class Ajax:System.Web.UI.Page
... ... {
protected void Page_Load (object sender, EventArgs e)
...... {
string result = "[{" CLS ":" Folder "," id ":" The Leaf ": false," children ": [{" CLS ":" File "," id ": One," leaf ": true," children ": NULL, "text": "S600"},{"CLS": "File", "id": "leaf": true, "children": null, "text": "SLK200"}, "text": "Business Unit"}];
Response.Write (Result);
}
}