js如何获取treeview选中节点的值? 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.cnblogs.com/renrenqq/archive/2004/05/20/10534.html <div id="resoucreDiv" style="width: 100%; margin-top: 5px; margin-bottom: 5px; background-color: White;"> <asp:TreeView ID="treeModule" runat="server" Width="100%" HoverNodeStyle-BackColor="White" BorderWidth="1" BorderStyle="Outset" BorderColor="#99bbe8"> <RootNodeStyle Font-Bold="True" Font-Size="11pt" /> </asp:TreeView></div>js[code=JScript] google.load("jquery", "1.4.3"); google.setOnLoadCallback(function() { //加载时判断父节点是否选中状态 // OnloadTreeNode(); //点击该div下的checkbox时加载点击事件 $("div[id='resoucreDiv'] input[type='checkbox']").bind("click", CheckSub); //返回 $("#btback").bind('click', function(key, val) { history.go(-1); }); //修改 $("#btModule").bind('click', GetJson); }); function OnloadTreeNode() { var isBoolen = false; alert($("div[id='treeModule']").children("div").length); $("div[id='resoucreDiv'] input[type='checkbox']").each(function(key, val) { if (parseInt(key) == 0) { TreeNodeId = $(this).attr("id").toString(); //得到父级ID号 } else { if ($(this).attr('checked')) isBoolen = true; } }); $("#" + TreeNodeId).attr("checked", isBoolen); } function CheckSub() { var TreeNodeId; //父级 var ClickChecked = $(this).attr("checked"); var ClickID = $(this).attr("id").toString(); var ParentTable = $(this).parent().parent().parent().parent().parent().prev(); //父级table var DomainTable= $(this).parent().parent().parent().parent().parent().prev().parent().prev(); //得到点击checkbox的域节点所在的tbale var DomainDiv= $(this).parent().parent().parent().parent().parent().prev().parent();//得到点击该checkbox所在的div集合 var thiDiv = $(this).parent().parent().parent().parent().parent(); //当前选中节点的父节点下面的所有子节点集合 var SubID = ClickID.replace("CheckBox", "Nodes"); //找到该节点下的所有子节点div的ID号 $("#" + SubID).find("input[type='checkbox']").attr("checked", ClickChecked); var isbool = false; $(thiDiv).find("input[type='checkbox']").each(function() { if ($(this).attr('checked')) isbool = true; }); $(ParentTable).find("input[type='checkbox']").attr("checked", isbool); var isBoolen = false; $(DomainDiv).find("input[type='checkbox']").each(function(key,val){ if ($(this).attr('checked')) isBoolen = true; }); $(DomainTable).find("input[type='checkbox']").attr("checked", isBoolen); //根据子节点选中状态来判断域节点的选中状态 }[/code] TreeView1.Attributes.Add("onclick", "ReturnValue()");function ReturnValue() { var objNode = event.srcElement; var unitid = event.srcElement.href; if (objNode.tagName != "SPAN") { return; } objNode.getAttribute("innerHtml");}http://topic.csdn.net/u/20100707/15/4d6ce6db-ea13-4e27-a331-3b08525e3a5b.html 一个正则小问题 使用 FredCK.FCKeditorV2的一个问题 出现 WebForm_SaveScrollPositionSubmit 未定义 这里没有新手区吗 公司想找人开发个广告联盟系统.net的,大概要多少钱? cookie的问题,郁闷啊! 文件下载时,默认文件名称在哪改? 我是新人,请大家给我个完整的连接SQL数据库的字符串,谢谢 如何将asp.net访问数据库的语句放在一个文件中调用??谢谢 请提供一个好的HTML学习书的电子版,我想学习ASP.net 去修改本机的DNS去得到一个网站的网通,电信IP 顶级域名绑定B网站二级目录的访问问题
<div id="resoucreDiv" style="width: 100%; margin-top: 5px; margin-bottom: 5px; background-color: White;">
<asp:TreeView ID="treeModule" runat="server" Width="100%" HoverNodeStyle-BackColor="White"
BorderWidth="1" BorderStyle="Outset" BorderColor="#99bbe8">
<RootNodeStyle Font-Bold="True" Font-Size="11pt" />
</asp:TreeView>
</div>js
[code=JScript]
google.load("jquery", "1.4.3");
google.setOnLoadCallback(function() { //加载时判断父节点是否选中状态
// OnloadTreeNode(); //点击该div下的checkbox时加载点击事件
$("div[id='resoucreDiv'] input[type='checkbox']").bind("click", CheckSub); //返回
$("#btback").bind('click', function(key, val) { history.go(-1); }); //修改
$("#btModule").bind('click', GetJson); }); function OnloadTreeNode() { var isBoolen = false;
alert($("div[id='treeModule']").children("div").length);
$("div[id='resoucreDiv'] input[type='checkbox']").each(function(key, val) {
if (parseInt(key) == 0) {
TreeNodeId = $(this).attr("id").toString(); //得到父级ID号
}
else {
if ($(this).attr('checked')) isBoolen = true;
}
});
$("#" + TreeNodeId).attr("checked", isBoolen);
} function CheckSub() { var TreeNodeId; //父级 var ClickChecked = $(this).attr("checked"); var ClickID = $(this).attr("id").toString(); var ParentTable = $(this).parent().parent().parent().parent().parent().prev(); //父级table
var DomainTable= $(this).parent().parent().parent().parent().parent().prev().parent().prev(); //得到点击checkbox的域节点所在的tbale
var DomainDiv= $(this).parent().parent().parent().parent().parent().prev().parent();//得到点击该checkbox所在的div集合 var thiDiv = $(this).parent().parent().parent().parent().parent(); //当前选中节点的父节点下面的所有子节点集合 var SubID = ClickID.replace("CheckBox", "Nodes"); //找到该节点下的所有子节点div的ID号 $("#" + SubID).find("input[type='checkbox']").attr("checked", ClickChecked); var isbool = false; $(thiDiv).find("input[type='checkbox']").each(function() { if ($(this).attr('checked'))
isbool = true;
});
$(ParentTable).find("input[type='checkbox']").attr("checked", isbool); var isBoolen = false; $(DomainDiv).find("input[type='checkbox']").each(function(key,val){
if ($(this).attr('checked')) isBoolen = true;
});
$(DomainTable).find("input[type='checkbox']").attr("checked", isBoolen); //根据子节点选中状态来判断域节点的选中状态
}[/code]
function ReturnValue() {
var objNode = event.srcElement;
var unitid = event.srcElement.href;
if (objNode.tagName != "SPAN") {
return;
}
objNode.getAttribute("innerHtml");
}http://topic.csdn.net/u/20100707/15/4d6ce6db-ea13-4e27-a331-3b08525e3a5b.html