js代码
<script type="text/javascript">
function onCheckBoxHander(pId,checked) {
var cb = $("input[id='"+pId+"'][type='checkbox']").parent().find("input");
cb.each(function(){
if(checked)
{
$(this).attr('checked','checked');
}else
{
$(this).attr('checked','');
}
});
}
$(document).ready(function(){
/*示例:监控所有节点的点击事件*/
$('input').click(function(){
var inputEl = $(this);
var pId = inputEl.attr('id');
var checked = inputEl.attr('checked');
onCheckBoxHander(pId,checked);
});
});
$(function() {
$("#browser").treeview({
collapsed: true,
animated: "medium",
control:"#sidetreecontrol",
persist: "location"
});