<%@ Page Language="C#" AutoEventWireup="true" Inherits="ViewProductTypeSelected" Codebehind="ViewProductTypeSelected.aspx.cs" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>请选择您所要的产品类别</title>
<script type ="text/javascript" src="ClientControls/common.js"></script>
<link href="clientcontrols/commonstyle.css" type="text/css" rel="stylesheet"/>
<base target="_self"/>
<% Response.Expires = -1 ;%>
</head>
<body style="background-image: url(ClientControls/img/back3.gif); overflow:hidden;">
<form id="form1" runat="server">
<div class="tbtitleStyle" style=" padding-top:8px;">
请选择您所要的产品类别
</div>
<div style ="overflow:hidden; height:100%; width :100%;text-align:left ;" class="titleBgStyle">
<asp:TreeView ID="tvwProductType" CssClass="MicroTree" runat="server" Height ="510px" Width="505px" ExpandDepth="10" ShowLines="True" AutoGenerateDataBindings="False" ShowCheckBoxes="All">
</asp:TreeView>
</div>
<div style ="display:none; ">
<input id="hid_test" type="hidden" name="hid_test" runat="server"/>
</div>
</form>
<script type="text/javascript">
function window.onload()
{
}
function CheckEvent()
{
try
{
var ReturnValue = "";
var objNode = event.srcElement;
var objID = objNode.getAttribute("ID");
var NodeText = objNode.innerText;
var objchild = objNode.children;
var count = objchild.length;
if (objID != "tvwProductType" && objNode.tagName != "IMG" && objID.tagName != "IMG")
{
if( NodeText != null && NodeText != "")
{
ReturnValue = NodeText;
}
}
if( objNode.tagName!= "INPUT" && objNode != "checkbox" &&
objID != "tvwProductType" && objNode.tagName != "IMG" && objID.tagName != "IMG")
{
var ID = window.event.srcElement.href.split(",")[1];
ID = ID.substr(2,ID.length-4);
if(ID.indexOf("\\\\") != -1)
{
ID = ID.split("\\\\");
ID = ID[ID.length-1];
}
var ID = escape(ID);
ReturnValue = ReturnValue + ";" + ID;
if( ReturnValue == null || ID == "0")
{
ReturnValue = "";
}
else
{
window.parent.returnValue = ReturnValue;
window.event.returnValue=false ;
window.close();
}
}
if(objNode.tagName=="INPUT" && objNode.type == "checkbox")
{
ReturnValue = window.event.srcElement.nextSibling.innerText;
var ID = window.event.srcElement.nextSibling.href.split(",")[1];
ID = ID.substr(2,ID.length-4);
if(ID.indexOf("\\\\") != -1)
{
ID = ID.split("\\\\");
ID = ID[ID.length-1];
}
var ID = escape(ID);
ReturnValue = ReturnValue + ";" + ID;
if( ReturnValue == null || ID == "0")
{
ReturnValue = "";
}
else if( ReturnValue.indexOf("*") != -1 )
{
ReturnValue = "";
} ReturnValue = ReturnValue + ",";
window.parent.returnValue = ReturnValue;//alert(ReturnValue);
window.event.returnValue = false;
window.close();
}
}
catch(err)
{
}
}
function btnSelect()
{
window.close();
}
</script>
</body>
</html>这是我的页面代码..我想让他实现treeview的多选.这个是一个公司的产品类别树.从数据库读取的节点,原先是单选的一切正常.现在是根本没法多选而且没法实现复选框的状态.点了也不会打勾新人小白求帮助了
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>请选择您所要的产品类别</title>
<script type ="text/javascript" src="ClientControls/common.js"></script>
<link href="clientcontrols/commonstyle.css" type="text/css" rel="stylesheet"/>
<base target="_self"/>
<% Response.Expires = -1 ;%>
</head>
<body style="background-image: url(ClientControls/img/back3.gif); overflow:hidden;">
<form id="form1" runat="server">
<div class="tbtitleStyle" style=" padding-top:8px;">
请选择您所要的产品类别
</div>
<div style ="overflow:hidden; height:100%; width :100%;text-align:left ;" class="titleBgStyle">
<asp:TreeView ID="tvwProductType" CssClass="MicroTree" runat="server" Height ="510px" Width="505px" ExpandDepth="10" ShowLines="True" AutoGenerateDataBindings="False" ShowCheckBoxes="All">
</asp:TreeView>
</div>
<div style ="display:none; ">
<input id="hid_test" type="hidden" name="hid_test" runat="server"/>
</div>
</form>
<script type="text/javascript">
function window.onload()
{
}
function CheckEvent()
{
try
{
var ReturnValue = "";
var objNode = event.srcElement;
var objID = objNode.getAttribute("ID");
var NodeText = objNode.innerText;
var objchild = objNode.children;
var count = objchild.length;
if (objID != "tvwProductType" && objNode.tagName != "IMG" && objID.tagName != "IMG")
{
if( NodeText != null && NodeText != "")
{
ReturnValue = NodeText;
}
}
if( objNode.tagName!= "INPUT" && objNode != "checkbox" &&
objID != "tvwProductType" && objNode.tagName != "IMG" && objID.tagName != "IMG")
{
var ID = window.event.srcElement.href.split(",")[1];
ID = ID.substr(2,ID.length-4);
if(ID.indexOf("\\\\") != -1)
{
ID = ID.split("\\\\");
ID = ID[ID.length-1];
}
var ID = escape(ID);
ReturnValue = ReturnValue + ";" + ID;
if( ReturnValue == null || ID == "0")
{
ReturnValue = "";
}
else
{
window.parent.returnValue = ReturnValue;
window.event.returnValue=false ;
window.close();
}
}
if(objNode.tagName=="INPUT" && objNode.type == "checkbox")
{
ReturnValue = window.event.srcElement.nextSibling.innerText;
var ID = window.event.srcElement.nextSibling.href.split(",")[1];
ID = ID.substr(2,ID.length-4);
if(ID.indexOf("\\\\") != -1)
{
ID = ID.split("\\\\");
ID = ID[ID.length-1];
}
var ID = escape(ID);
ReturnValue = ReturnValue + ";" + ID;
if( ReturnValue == null || ID == "0")
{
ReturnValue = "";
}
else if( ReturnValue.indexOf("*") != -1 )
{
ReturnValue = "";
} ReturnValue = ReturnValue + ",";
window.parent.returnValue = ReturnValue;//alert(ReturnValue);
window.event.returnValue = false;
window.close();
}
}
catch(err)
{
}
}
function btnSelect()
{
window.close();
}
</script>
</body>
</html>这是我的页面代码..我想让他实现treeview的多选.这个是一个公司的产品类别树.从数据库读取的节点,原先是单选的一切正常.现在是根本没法多选而且没法实现复选框的状态.点了也不会打勾新人小白求帮助了
解决方案 »
- 江湖救急啊,大侠们都来看看吧
- Asp.net 页面引用两个不同的日期控件(控件均引入梅花雪的js文件)结果两控件的外在表现是一样的即只有一个控件被引入
- 谁用过飞天诚信的epass1000nd?
- Cookie的问题真不知道怎么解决
- select 语句问题?
- 心情不太好,散点分问问题!aspnetmenu注册和不注册有差别吗???知道的告诉我,不知道的来接分!
- 急聘2名ASP+MSSQL网络开发人员,在首都在线工作,说希望工资!!!!!!
- iso文件怎样才可以安装?
- 关于datalist中控件读取的问题
- 强烈要求高手(有做过图片从数据库存取经验)到里面讨论一个富有挑战的问题!
- 复杂的联合查询搜索,求高效率解决方案
- iTextSharp用法
ShowCheckBoxes="All" http://topic.csdn.net/u/20100306/19/66863968-95da-4adf-b071-71a3a49e8627.html
//节点复选框操作
function OnTreeNodeChecked() {
var element = element = window.event.srcElement; if (!IsCheckBox(element))
return; var isChecked = element.checked;
var tree = TV2_GetTreeById('<%=tv.ClientID %>');//树控件ID
var node = TV2_GetNode(tree, element); TV2_SetChildNodesCheckStatus(node, isChecked); var parent = TV2_GetParentNode(tree, node); TV2_NodeOnChildNodeCheckedChanged(tree, parent, isChecked);
}
</script>