ztree属性和后台treemodel的对应关系

时间:2022-03-10 12:37:03

ztree 中nodes设置的属性和,treeModel中定义的属性对应一致:

前台jsp文件

//创建树
var zNodes =[
{id:0,pId:null,name:'流程类型',dbId:null,open:true,isParent:true,typeId:null}
<%for (int i = 0; i < treeNodeList.size(); i++) {
%>
,{id:<%=treeNodeList.get(i).getId()%>,pId:<%=treeNodeList.get(i).getpId()%>,
name:'<%=treeNodeList.get(i).getName()%>',dbId:<%=treeNodeList.get(i).getDbId()%>,
open:<%=treeNodeList.get(i).isOpen()%>,isParent:false,
typeId:<%=treeNodeList.get(i).getTypeId()%>
}
<%}%>
];

后台java类

ztree属性和后台treemodel的对应关系public class TreeNodeModel implements Serializable{

private static final long serialVersionUID = 1L;
public static final String FILE_NODE_ID="-1";//归档文件
public static final String VOL_NODE_ID="-2";//案卷
public static final String FILEARC_NODE_ID="-3";//文件
public static final String PRO_NODE_ID="-4";//文件
public static final String VOL_NODE_NAME="案卷";
public static final String FILE_NODE_NAME="归档文件";
public static final String FILEARC_NODE_NAME="文件";
public static final String PRO_NODE_NAME="项目";
//节点Id
private String id;
//父Id
private String pId;
//节点Name
private String name;

private Integer typeId;
//真实数据节点bdid
private Integer dbId;

private boolean open=false;

private String isParent="true";

private String columns;
private String values;
private String icon;

同理easyui datagrid的定义的表头field属性:也要和数据的属性对应