diff --git a/README.md b/README.md index 2b2e464df3dedb9f68401c0d434ed28255ede3ce..65e6299b47b52ed7790f241ebf4f7823353b855f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ jQuery Tree Plugin ---- zTree ============ -last verson : 3.5.42 +last verson : 3.5.43 **Donate to zTree** : http://www.treejs.cn/v3/donate.php diff --git a/api/API_cn.html b/api/API_cn.html index c1997512e29a865f10c12aa7f316751c9f59c7de..a8b1acd717b99e37898c7193ac01a85f402e28c1 100644 --- a/api/API_cn.html +++ b/api/API_cn.html @@ -35,7 +35,7 @@
all.js = core + excheck + exedit ( 不包括 exhide ); 发现错误请及时通知,谢谢。
all.js = core + excheck + exedit ( without exhide ); if you found some mistakes please contact me.
使用 className 设置文字样式,只针对 zTree 在节点上显示的<A>对象。便于 css 与 js 解耦
+默认值:{add: [], remove: []}
+v3.5.43+
+add: Array,需要添加的 className 集合 例如:{add: ['highlight']}
+remove: Array,需要删除的 className 集合 例如:{remove: ['highlight']}
+对应 zTree 的 treeId,便于用户操控
+需要设置自定义样式的节点 JSON 数据对象
+返回值同 JSON 格式的数据,例如:{add: ['highlight'], remove: ['hide']}
+
+var setting = {
+ view: {
+ nodeClasses : {add: ['highlight']}
+ }
+};
+ var setting = {
+ view: {
+ nodeClasses : {remove: ['highlight']}
+ }
+};
+ function setNodeClasses(treeId, treeNode) {
+ return treeNode.level == 0 ? {add: ['highlight']} : {remove: ['highlight']};
+};
+var setting = {
+ view: {
+ nodeClasses: setNodeClasses
+ }
+};
+Use className to set text style, only applies to <A> object in the node DOM. (Decoupling CSS from JavaScript)
+Default: {add: [], remove: []}
+v3.5.43+
+add: Array, The className collection to be added. e.g. {add: ['highlight']}
+remove: Array, The className collection to be removed. e.g. {remove: ['highlight']}
+zTree unique identifier: treeId.
+JSON data object of the node which use the personalized text style
+Return value is same as 'JSON Format'. e.g. {add: ['highlight'], remove: ['hide']}
+
+ var setting = {
+ view: {
+ nodeClasses : {add: ['highlight']}
+ }
+ };
+ var setting = {
+ view: {
+ nodeClasses : {remove: ['highlight']}
+ }
+ };
+ function setNodeClasses(treeId, treeNode) {
+ return treeNode.level == 0 ? {add: ['highlight']} : {remove: ['highlight']};
+};
+var setting = {
+ view: {
+ nodeClasses: setNodeClasses
+ }
+};
+