function AddEventForCHK(treeViewID) {//treeView.ClientID
$("#"+ treeViewID +" :checkbox").bind("change", SetChildChk);
}
function SetChildChk() {
var parentChk = $(this);
var childID = parentChk.attr("id").replace("CheckBox", "Nodes");
$("#"+ childID +" :checkbox").attr("checked",
function () { return parentChk.attr("checked"); }
);
}
$("#"+ treeViewID +" :checkbox").bind("change", SetChildChk);
}
function SetChildChk() {
var parentChk = $(this);
var childID = parentChk.attr("id").replace("CheckBox", "Nodes");
$("#"+ childID +" :checkbox").attr("checked",
function () { return parentChk.attr("checked"); }
);
}
只对子项联动,对父项无关
玩技术,要学会忍受寂寞--