jQuery MiniUI

标题: TreeGrid的parentField [打印本页]

作者: 丁丁与豆豆    时间: 2016-8-3 09:44:41     标题: TreeGrid的parentField

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



作者: dforce    时间: 2016-8-3 10:12:46

如果你parentField是parete.id
那么你的数据需要是这样的格式{id:"",parent:{id:""}.....

作者: 丁丁与豆豆    时间: 2016-8-3 10:13:49

dforce 发表于 2016-8-3 10:12
如果你parentField是parete.id
那么你的数据需要是这样的格式{id:"",parent:{id:""}.....
...

是这样的格式,我下面的columns里都能取到,看上面的图
作者: dforce    时间: 2016-8-3 10:19:31

丁丁与豆豆 发表于 2016-8-3 10:13
是这样的格式,我下面的columns里都能取到,看上面的图

resultAsTree="false"
作者: 丁丁与豆豆    时间: 2016-8-3 10:35:35

dforce 发表于 2016-8-3 10:19
resultAsTree="false"

还是无法识别“parent.id”
作者: dforce    时间: 2016-8-3 11:01:58

丁丁与豆豆 发表于 2016-8-3 10:35
还是无法识别“parent.id”

那就是你的数据的问题了,请提供数据和html
作者: 丁丁与豆豆    时间: 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}]}
复制代码


作者: dforce    时间: 2016-8-3 13:51:33

丁丁与豆豆 发表于 2016-8-3 13:45

resultAsTree="false"修改之后肯定呈现树形
[attach]7729[/attach]

作者: 丁丁与豆豆    时间: 2016-8-3 14:35:18

dforce 发表于 2016-8-3 13:51
resultAsTree="false"修改之后肯定呈现树形

我看下你html怎么写的
作者: dforce    时间: 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">
作者: 丁丁与豆豆    时间: 2016-8-3 16:02:43

dforce 发表于 2016-8-3 14:58

我把你写的全部复制进去,还是没有树。。。。
作者: dforce    时间: 2016-8-3 16:25:47

丁丁与豆豆 发表于 2016-8-3 16:02
我把你写的全部复制进去,还是没有树。。。。

[attach]7730[/attach]我本地用你的数据,配合这段html,是可以显示的,如上面的截图
作者: 丁丁与豆豆    时间: 2016-8-3 18:01:05

dforce 发表于 2016-8-3 16:25
我本地用你的数据,配合这段html,是可以显示的,如上面的截图

你给我发的展示,是什么版本的Mini
作者: 丁丁与豆豆    时间: 2016-8-4 08:58:50

dforce 发表于 2016-8-3 16:25
我本地用你的数据,配合这段html,是可以显示的,如上面的截图

mini 3.4 ,支持parentField="parent.id"吗
作者: dforce    时间: 2016-8-4 09:27:08

丁丁与豆豆 发表于 2016-8-4 08:58
mini 3.4 ,支持parentField="parent.id"吗

请使用最新版本




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2