Ajax 获取数据的 URL 地址。[setting.async.enable = true 时生效]
默认值:""
设置固定的异步加载 url 字符串,请注意地址的路径,确保页面能正常加载
url 内也可以带参数,这些参数就只能是通过 get 方式提交了,并且请注意进行转码
对应 zTree 的 treeId,便于用户操控
需要异步加载子节点的的父节点 JSON 数据对象
针对根进行异步加载时,treeNode = null
返回值同 String 格式的数据
var setting = {
async: {
enable: true,
url: "nodes.php",
autoParam: ["id", "name"]
}
};
......
function getAsyncUrl(treeId, treeNode) {
return treeNode.isParent ? "nodes1.php" : "nodes2.php";
};
var setting = {
async: {
enable: true,
url: getAsyncUrl,
autoParam: ["id", "name"]
}
};
......