jQuery MiniUI

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

列表内下拉树无法正常按层级展示 [复制链接]

Rank: 2

跳转到指定楼层
楼主
发表于 2017-3-28 16:28:03 |只看该作者 |倒序浏览

<div width="60" field="code" headerAlign="center"
                type="treeselectcolumn">
                                                代码<input property="editor" class="mini-treeselect"
                                                                                        data="ceshi" multiSelect="true" textField="text"
                                                                                        valueField="id" parentField="pid" allowInput="true"
                                                                                        style="width: 98%;" /></div>

var ceshi = [ {
                        id : "base",
                        text : "Base",
                }, {
                        id : "ajax",
                        text : "Ajax",
                        pid : "base",
                        isLeaf : true
                }, {
                        id : "json",
                        text : "JSON",
                        pid : "base",
                        isLeaf : true
                }, {
                        id : "date",
                        text : "Date",
                        pid : "base",
                        checked : true
                }, {
                        id : "control",
                        text : "Control",
                        pid : "base"
                }, {
                        id : "other",
                        text : "Other",
                        isLeaf : false,
                        asyncLoad : false
                } ];

这样的


Rank: 8Rank: 8

沙发
发表于 2017-3-28 16:43:59 |只看该作者
data加载的话只能是树形数据,用children字段包含父节点的
你这数据是列表数据
var ceshi = [ {
                        id : "base",
                        text : "Base",
                        children:[{
                        id : "ajax",
                        text : "Ajax",
                        pid : "base",
                        isLeaf : true
                }, {
                        id : "json",
                        text : "JSON",
                        pid : "base",
                        isLeaf : true
                }, {
                        id : "date",
                        text : "Date",
                        pid : "base",
                        checked : true
                }, {
                        id : "control",
                        text : "Control",
                        pid : "base"
                }]
                }, {
                        id : "other",
                        text : "Other",
                        isLeaf : false,
                        asyncLoad : false
                } ];

Rank: 2

板凳
发表于 2017-3-28 16:57:25 |只看该作者
dforce 发表于 2017-3-28 16:43
data加载的话只能是树形数据,用children字段包含父节点的
你这数据是列表数据
var ceshi = [ {

这个数据是来自minui的文件listTree.txt,里面的的层级就像我之前发的一样,却可以展示,我把数据考出来定义在页面上,却又不显示,url解析方式跟直接定义在下面不一样?

Rank: 8Rank: 8

地板
发表于 2017-3-28 17:02:31 |只看该作者
335188770 发表于 2017-3-28 16:57
这个数据是来自minui的文件listTree.txt,里面的的层级就像我之前发的一样,却可以展示,我把数据考出来 ...

url加载有属性resultAsTree配合可以是树形可以是列表,data加载只能是树形数据

Archiver|普加软件

GMT+8, 2024-9-29 04:15 , Processed in 1.027881 second(s), 9 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部