代碼:
var setting = {
async: {
enable: true,
url: "BDSys_List.ashx?&action=userTree",
asyncParam: ["id", "pId", "name"], //異步調用時傳到后臺的參數
otherParam: { "otherParam": "zTreeAsyncTest" },
dataFilter: filter
}
};
function filter(treeId, parentNode, childNodes) {
for (var i = 0; i < childNodes.Rows.length; i++) {
childNodes.Rows[0]['open'] = true;
childNodes.Rows[i]['id'] = i;
childNodes.Rows[i]['pId'] = 0;
childNodes.Rows[i]['name'] = childNodes.Rows[i]['DeviceID'];
}
return childNodes.Rows;
}
$(function () {
$.fn.zTree.init($("#userTree"), setting);
});
?
首次的時候就加載了列表 在點擊節點的時候 就沒有提交請求了 我在服務器打了斷點 只有第一次進來了?? 請問大俠 問題在那呢?
2 回答

拉風的咖菲貓
TA貢獻1995條經驗 獲得超2個贊
缺少回調事件?
callback: {
beforeExpand: function (treeId, treeNode) {
zTree.setting.async.url = "BDSys_List.ashx?&action=userTree";
if (treeNode.isParent) {
zTree.expandNode(treeNode);
return false;
}
}
}
添加回答
舉報
0/150
提交
取消