jQuery MiniUI

 找回密码
 立即注册
查看: 7446|回复: 14
打印 上一主题 下一主题

TreeGrid的parentField [复制链接]

Rank: 2

跳转到指定楼层
楼主
发表于 2016-8-3 09:44:41 |只看该作者 |倒序浏览

现在我用TreeGrid,
其中你们有个配置参数parentField,
我在下面的columns中的field都能识别到"parent.id",你们的parentField要怎么配置才能识别到"parent.id"。


附件: 你需要登录才可以下载或查看附件。没有帐号?立即注册

Rank: 8Rank: 8

沙发
发表于 2016-8-3 10:12:46 |只看该作者
如果你parentField是parete.id
那么你的数据需要是这样的格式{id:"",parent:{id:""}.....

Rank: 2

板凳
发表于 2016-8-3 10:13:49 |只看该作者
dforce 发表于 2016-8-3 10:12
如果你parentField是parete.id
那么你的数据需要是这样的格式{id:"",parent:{id:""}.....
...

是这样的格式,我下面的columns里都能取到,看上面的图

Rank: 8Rank: 8

地板
发表于 2016-8-3 10:19:31 |只看该作者
丁丁与豆豆 发表于 2016-8-3 10:13
是这样的格式,我下面的columns里都能取到,看上面的图

resultAsTree="false"

Rank: 2

5#
发表于 2016-8-3 10:35:35 |只看该作者
dforce 发表于 2016-8-3 10:19
resultAsTree="false"

还是无法识别“parent.id”

Rank: 8Rank: 8

6#
发表于 2016-8-3 11:01:58 |只看该作者
丁丁与豆豆 发表于 2016-8-3 10:35
还是无法识别“parent.id”

那就是你的数据的问题了,请提供数据和html

Rank: 2

7#
发表于 2016-8-3 13:45:22 |只看该作者
dforce 发表于 2016-8-3 11:01
那就是你的数据的问题了,请提供数据和html

  1. <div id="treegrid" class="mini-treegrid" style="width: 100%; height: 100%;"
  2.                                 url="${basePath}syt/zhgl/xmqkb/querylist.htm?type=${type}" resultAsTree="true" dataField="data"   
  3.                             treeColumn="taskname" idField="id" parentField="parent.id"
  4.                             showTreeIcon="false" showTreeLines="true"
  5.                         >
  6.                             <div property="columns">
  7.                                 <div type="checkcolumn" width="4"></div>
  8.                                         <div type="indexcolumn" headerAlign="center" width="6">序号</div>
  9.                                         <!-- <div field="parent.id" headerAlign="center" align="left" width="10">父名称</div> -->
  10.                                 <div name="taskname" field="xmmc" headerAlign="center" align="left" width="20">项目名称</div>
  11.                                         <div headerAlign="center" renderer="onActionFiled" width="14">扩展字段</div>
  12.                                         <div headerAlign="center" renderer="onActionConfig" width="14">维护</div>
  13.                                         <div field="kssj" headerAlign="center" align="left" width="10" dateFormat="yyyy-MM-dd">申请开始时间</div>
  14.                                         <div field="jssj" headerAlign="center" align="left" width="10" dateFormat="yyyy-MM-dd">申请结束时间</div>
  15.                                         <div field="spkssj" headerAlign="center" align="left" width="10" dateFormat="yyyy-MM-dd">审批开始时间</div>
  16.                                         <div field="spjssj" headerAlign="center" align="left" width="10" dateFormat="yyyy-MM-dd">审批结束时间</div>
  17.                                         <div headerAlign="center" renderer="onActionRenderer" width="14">操作</div>
  18.                             </div>
  19.                         </div>
复制代码
  1. {"pageNo":"1","pageSize":"1","pageTotal":"1","totalPage":1,"currentPage":1,"total":4,"pageRecord":10,"detachedCriteria":null,"data":[{"id":"40282e81563427da0156345316cb0000","xmmc":"第二校园活动项目","kssj":"2016-08-01T00:00:00","jssj":"2016-08-05T00:00:00","spkssj":"2016-08-06T00:00:00","spjssj":"2016-08-09T00:00:00","sfscmb":"否","type":"XYHD","hasrole":null,"bz":"zzz","sfksq":true,"sfksp":false,"xgsm":null,"ly":null,"spjd":null,"k1":null,"k2":null,"k3":null,"k4":null,"k5":null,"k6":null,"k7":null,"k8":null,"k9":null,"k10":null,"parent":{"id":"40282e81563050bd01563096311b040d","xmmc":"第一校园活动项目","kssj":"2016-08-01T00:00:00","jssj":"2016-08-05T00:00:00","spkssj":"2016-08-08T00:00:00","spjssj":"2016-08-10T00:00:00","sfscmb":"是","type":"XYHD","hasrole":"402881fc55b475380155b4c381890001,402881fc55b475380155b4c25efd0000","bz":"dddd","sfksq":true,"sfksp":false,"xgsm":null,"ly":null,"spjd":null,"k1":null,"k2":null,"k3":null,"k4":null,"k5":null,"k6":null,"k7":null,"k8":null,"k9":null,"k10":null,"parent":null}},{"id":"40282e81564e757001564e7850bf0001","xmmc":"活动2","kssj":"2016-08-03T00:00:00","jssj":"2016-08-05T00:00:00","spkssj":"2016-08-06T00:00:00","spjssj":"2016-08-07T00:00:00","sfscmb":"是","type":"XYHD","hasrole":null,"bz":"ddd","sfksq":true,"sfksp":false,"xgsm":null,"ly":null,"spjd":null,"k1":null,"k2":null,"k3":null,"k4":null,"k5":null,"k6":null,"k7":null,"k8":null,"k9":null,"k10":null,"parent":{"id":"40282e81564e757001564e77c88d0000","xmmc":"活动1","kssj":"2016-08-04T00:00:00","jssj":"2016-08-05T00:00:00","spkssj":"2016-08-06T00:00:00","spjssj":"2016-08-07T00:00:00","sfscmb":"否","type":"XYHD","hasrole":null,"bz":"zzz","sfksq":false,"sfksp":false,"xgsm":null,"ly":null,"spjd":null,"k1":"zz","k2":"ddd","k3":"2016-08-04T00:00:00","k4":null,"k5":null,"k6":null,"k7":null,"k8":null,"k9":null,"k10":null,"parent":null}},{"id":"40282e81564e757001564e77c88d0000","xmmc":"活动1","kssj":"2016-08-04T00:00:00","jssj":"2016-08-05T00:00:00","spkssj":"2016-08-06T00:00:00","spjssj":"2016-08-07T00:00:00","sfscmb":"否","type":"XYHD","hasrole":null,"bz":"zzz","sfksq":false,"sfksp":false,"xgsm":null,"ly":null,"spjd":null,"k1":"zz","k2":"ddd","k3":"2016-08-04T00:00:00","k4":null,"k5":null,"k6":null,"k7":null,"k8":null,"k9":null,"k10":null,"parent":null},{"id":"40282e81563050bd01563096311b040d","xmmc":"第一校园活动项目","kssj":"2016-08-01T00:00:00","jssj":"2016-08-05T00:00:00","spkssj":"2016-08-08T00:00:00","spjssj":"2016-08-10T00:00:00","sfscmb":"是","type":"XYHD","hasrole":"402881fc55b475380155b4c381890001,402881fc55b475380155b4c25efd0000","bz":"dddd","sfksq":true,"sfksp":false,"xgsm":null,"ly":null,"spjd":null,"k1":null,"k2":null,"k3":null,"k4":null,"k5":null,"k6":null,"k7":null,"k8":null,"k9":null,"k10":null,"parent":null}]}
复制代码

Rank: 8Rank: 8

8#
发表于 2016-8-3 13:51:33 |只看该作者
丁丁与豆豆 发表于 2016-8-3 13:45

resultAsTree="false"修改之后肯定呈现树形

附件: 你需要登录才可以下载或查看附件。没有帐号?立即注册

Rank: 2

9#
发表于 2016-8-3 14:35:18 |只看该作者
dforce 发表于 2016-8-3 13:51
resultAsTree="false"修改之后肯定呈现树形

我看下你html怎么写的

Rank: 8Rank: 8

10#
发表于 2016-8-3 14:58:11 |只看该作者
丁丁与豆豆 发表于 2016-8-3 14:35
我看下你html怎么写的

<div id="treegrid" class="mini-treegrid" style="width: 600px; height: 400px;" url="t24.txt"
        resultastree="false" datafield="data" treecolumn="taskname" idfield="id" parentfield="parent.id"
        showtreeicon="true" showtreelines="true">

Archiver|普加软件

GMT+8, 2024-11-17 05:08 , Processed in 1.042432 second(s), 10 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部