<table id="unit_list_grid" class="easyui-treegrid"
data-options="
rownumbers:true,
url:'${pageContext.request.contextPath }/sysUnit/showList.do',
idField : 'id',
treeField : 'name',
fit:true,
parentField : 'parentId',
fitColumns : true,
animate:true,
state:'closed',
onClickRow:function(row) {UnitList.onClikNode(row)},
onLoadSuccess:function(row, data){UnitList.onLoadSuccess(row, data)},
onContextMenu: function(e,node){UnitList.showRight(e,node);}">
<thead>
<tr>
<th data-options="field:'id',hidden:true"></th>
<th data-options="field:'name',width:180">单位名称</th>
<th data-options="field:'coding',width:100">单位编号</th>
<th data-options="field:'type',width:180">单位类型</th>
<th data-options="field:'status',width:80,
formatter: function(value,row,index){if (row.status==1){return '启用';} else {return '停用';}}">状态</th>
</tr>
</thead>
</table>
这是表格,默认值显示第一级和第二级节点数据怎么实现?,网上查了一下,还是没搞明白
看tree的state配置,默认为open,大于3级的数据节点增加state:'close'
Tree Data Format
Every node can contains following properties:
id: node id, which is important to load remote data
text: node text to show
state: node state, 'open' or 'closed', default is 'open'. When set to 'closed', the node have children nodes and will load them from remote site
checked: Indicate whether the node is checked selected.
attributes: custom attributes can be added to a node
children: an array nodes defines some children nodes