setting.async.url 中如果有动态参数时候有效?
ztree吧
全部回复
仅看楼主
level 5
小阳糖1r 楼主
我设置了 setting.async.url : "ttt.jsp?selValues="+selCheckboxvalues;
其中selCheckboxvalues是页面上选中的checkbox值,是根据页面上选中的值而动态变化的,但我发现每次选中checkbox并赋值给变量selCheckboxvalues的时候,ztree并不会有任何变化,也就是说setting.async.url 似乎是ztree第一次加载的时候就决定了的,设置的那个动态变量参数selCheckboxvalues实际上并没有起作用,是这样吗? 究竟应该如何吧参数传递给setting.async.url 呢?
2013年03月06日 05点03分 1
level 5
小阳糖1r 楼主
哦,我知道了,刚刚在api中查到了
setting & function 举例1. 设置异步获取节点的 URL 为 nodes.phpvar setting = {
async: {
enable: true,
url: "nodes.php",
autoParam: ["id", "name"]
}
};
......2. 设置异步获取节点的 URL 为 function 动态获取function getAsyncUrl(treeId, treeNode) {
return treeNode.isParent ? "nodes1.php" : "nodes2.php";
};
var setting = {
async: {
enable: true,
url: getAsyncUrl,
autoParam: ["id", "name"]
}
};
......
2013年03月06日 05点03分 2
1