1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| var setting = { check:{ enable:true }, data: { simpleData: { enable: true, idKey: "typeId", pIdKey:"typeFid", rootPId: 0 }, key:{ name:"typeName", } } };
function zTree(){ data = [ {id:1, pId:0, name: "父节点1"}, {id:11, pId:1, name: "子节点1"}, {id:12, pId:1, name: "子节点2"} ]; var treeObj = $.fn.zTree.init($("#treeConfig"), setting, tableData); treeObj.expandAll(true); }
|