复制代码 代码如下:
TreeNode newNode = new TreeNode();
newNode.Text = “showText”;
newNode.Value =id;
newNode.NavigateUrl = id; // 可用来在javascript中获取需要的value或text值
newNode.ShowCheckBox = true; //显示checkbox
newNode.Expanded = false; //节点折叠
newNode.Checked = true; //checkbox选中
复制代码 代码如下:
var idlist;
function GeSelectedNode() {
var getAllNodes = "";
idlist = new Array(); //实例化数组
var tree = document.getElementById("treenameOrid").getElementsByTagName("input");
for (var i = 0; i < tree.length; i++) {
if (tree[i].type == "checkbox" && tree[i].checked) {
var s = tree[i].nextSibling.pathname; //要用此属性获取值,必须设置属性newNode.NavigateUrl = 需要的值;
getAllNodes += s + 'http://www.vevb.com/';
idlist.push(s); //将值添加入数组最后一项;
}
}
alert(tree.length);
alert(getAllNodes);
}
新闻热点
疑难解答
图片精选