level 2
凯磊流果2W
楼主
我这个是按照官网上面的介绍来写的,为什么当我选择后在点击checkbox不会取消选择?求大神解答
$(function() {
$( "#consoleDlg" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true
});
});
var treeSetting891 = {
check: {
enable: true
},
view: {
dblClickExpand: false,
showLine: true,
selectedMulti: false
},
data: {
simpleData: {
enable:true,
idKey: "id",
pIdKey: "pId",
rootPId: ""
}
},
callback: {
beforeClick: function(treeId, treeNode) {
}
}
};
$.ajax({
url: "/omp/report?qid=891&rows=1000&page=1",
type: "GET",
cache:false,
dataType: "json",
success: function (data) {
var rows = data.rows;
var nodes = [];
for(var i=0;i<rows.length;i++){
var pid = rows[i][2];
if (pid == "0") {
rows[i] = {
"id": rows[i][0],
"pId": rows[i][1],
"name": rows[i][2],
"open":"false"
};
nodes.push(rows[i]);
} else {
rows[i] = {
"id": rows[i][0],
"pId": rows[i][1],
"name": rows[i][2]
};
nodes.push(rows[i]);
}
}
var other891 = $("#other891");
other891.attr("class","ztree");
other891.attr("style","float:left;margin: 10px");
$.fn.zTree.init(other891,treeSetting891,nodes);
}
});
2014年04月14日 07点04分
1
$(function() {
$( "#consoleDlg" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true
});
});
var treeSetting891 = {
check: {
enable: true
},
view: {
dblClickExpand: false,
showLine: true,
selectedMulti: false
},
data: {
simpleData: {
enable:true,
idKey: "id",
pIdKey: "pId",
rootPId: ""
}
},
callback: {
beforeClick: function(treeId, treeNode) {
}
}
};
$.ajax({
url: "/omp/report?qid=891&rows=1000&page=1",
type: "GET",
cache:false,
dataType: "json",
success: function (data) {
var rows = data.rows;
var nodes = [];
for(var i=0;i<rows.length;i++){
var pid = rows[i][2];
if (pid == "0") {
rows[i] = {
"id": rows[i][0],
"pId": rows[i][1],
"name": rows[i][2],
"open":"false"
};
nodes.push(rows[i]);
} else {
rows[i] = {
"id": rows[i][0],
"pId": rows[i][1],
"name": rows[i][2]
};
nodes.push(rows[i]);
}
}
var other891 = $("#other891");
other891.attr("class","ztree");
other891.attr("style","float:left;margin: 10px");
$.fn.zTree.init(other891,treeSetting891,nodes);
}
});