jQuery MiniUI

标题: 列表内下拉树无法正常按层级展示 [打印本页]

作者: 335188770    时间: 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
                } ];

这样的



作者: dforce    时间: 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
                } ];
作者: 335188770    时间: 2017-3-28 16:57:25

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

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

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

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




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