function ChangeStatus(iCategoryID)
{
var li_father = el("li_" + iCategoryID);
if (li_father.className == "Closed")
{
li_father.className = "Opened";
}
else
{
li_father.className = "Closed";
}
}
function switchNote(iCategoryID, show)
{
var li_father = el("li_" + iCategoryID);
if (show)
{
var ul = document.createElement("ul");
ul.id = "ul_note_" + iCategoryID;
var note = document.createElement("li");
note.className = "Child";
var img = document.createElement("img");
img.className = "s";
img.src = "../../Styles/tree_CSS/s.gif";
var a = document.createElement("a");
a.href = "JavaScript:void(0);";
a.innerHTML = "请稍候";
note.appendChild(img);
note.appendChild(a);
ul.appendChild(note);
li_father.appendChild(ul);
}
else
{
var ul = el("ul_note_" + iCategoryID);
if (ul)
{
li_father.removeChild(ul);
}
}
}
// 加载根节点
var tree = el("CategoryTree");
var root = document.createElement("li");
root.id = "li_0";
tree.appendChild(root);
// 加载页面时显示第一级分类
ExpandSubCategory(0);
function PreloadFormUrl(iCategoryID)
{
// 采用同步调用的方式获取图片的信息
var ds = AjaxMethod.GetFormsList(iCategoryID).value;
// 如果返回了结果
if (ds)
{
// 判断数据表是否不为空
if (ds.Tables[0].Rows.length > 0)
{
// 返回的信息数据表
dt = ds.Tables[0];
el("furl").src = dt.Rows[0].FormUrl;
}
else // 分类下没有
{
}
}
}
</script>
</form>
</body>
</html>2.cs代码
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HTMLControls;
using AjaxPro;
public partial class Pages_Home_HomePage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Utility.RegisterTypeForAjax(typeof(AjaxMethod));
}
}3.建立一个tree.CSS的CSS样式
a
{}{
text-decoration:none;
}
a,a:visited
{}{
color:#000;
background:inherit;
}
body
{}{
margin:0;
padding:20px;
font:12px tahoma,宋体,sans-serif;
}
dt
{}{
font-size:22px;
font-weight:bold;
margin:0 0 0 15px;
}
dd
{}{
margin:0 0 0 15px;
}
h4
{}{
margin:0;
padding:0;
font-size:18px;
text-align:center;
}
p
{}{
margin:0;
padding:0 0 0 18px;
}
p a,p a:visited
{}{
color:#00f;
background:inherit;
}
.TreeMenu img.s
{}{
cursor:hand;
vertical-align:middle;
}
.TreeMenu ul
{}{
padding:0;
}
.TreeMenu li
{}{
list-style:none;
padding:0;
}
.Closed ul
{}{
display:none;
}
.Child img.s
{}{
background:none;
cursor:default;
}
#CategoryTree ul
{}{
margin:0 0 0 17px;
}
|