jQuery MiniUI

标题: tree-grid [打印本页]

作者: wansgibo    时间: 2014-8-7 19:34:14     标题: tree-grid

我用一个事件来走后台的ajax查询  然后回来这个树表格是没用的。单数据都对上了、这是为什么?

<div id="dssTypeGridLM" class="mini-treegrid" style="width:100%;height:100%;"  
            showTreeIcon="true" treeColumn="treeName" idField="dssTypeId" parentField="parDssTypeId"
            resultAsTree="false" allowResize="true" expandOnLoad="true" multiSelect="true">
                    <div property="columns">
                        <div type="indexcolumn"></div>
                        <div type="checkcolumn"></div>
                        <div name="treeName" field="dssTypeCode" width="160"
                            allowSort="true" headerAlign="left">编码</div>



$.ajax({
            type: "POST",
            //对应GRID的url属性
            url: basePath+"mems/dss/findDssTypeShowList?facilityCat=01",
            dataType: "json",
            contentType: "application/json",
            success: function (data) {
                //alert(data);
                dssTypeGridLM.setData(data);
                //dssTypeGridLM.load();
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                mini.alert(errorThrown);
            }
        });


作者: felt    时间: 2014-8-7 20:29:07

tree和treegrid都是自动加载的
标签上设置autoLoad="false"
作者: wansgibo    时间: 2014-8-7 20:33:19

felt 发表于 2014-8-7 20:29
tree和treegrid都是自动加载的
标签上设置autoLoad="false"

[attach]4971[/attach] 还是不行啊。

[{"dssTypeId":"2","quntUnitl":null,"quntUnitk":null,"quntUnitg":null,"quntUnitm":null,"quntUnitt":null,"quntUnid":null,"quntUnic":null,"quntUniz":null,"quntUnit":"2","orgCode":"2","parDssTypeId":"1","dssTypeCode":"2","dssTypeName":"01","facilityCat":"01","mmbrType":"2","dssDegree":"2","quntRule":"2","qultDescWay":"2","dssRefImg":"2","dssDrawIcon":"2"},{"dssTypeId":"1","quntUnitl":null,"quntUnitk":null,"quntUnitg":null,"quntUnitm":null,"quntUnitt":null,"quntUnid":null,"quntUnic":null,"quntUniz":null,"quntUnit":"1","orgCode":"1","parDssTypeId":"0","dssTypeCode":"1","dssTypeName":"01","facilityCat":"01","mmbrType":"1","dssDegree":"1","quntRule":"1","qultDescWay":"1","dssRefImg":"1","dssDrawIcon":"1"},{"dssTypeId":"3","quntUnitl":null,"quntUnitk":null,"quntUnitg":null,"quntUnitm":null,"quntUnitt":null,"quntUnid":null,"quntUnic":null,"quntUniz":null,"quntUnit":"3","orgCode":"3","parDssTypeId":"1","dssTypeCode":"3","dssTypeName":"01","facilityCat":"01","mmbrType":"3","dssDegree":"3","quntRule":"3","qultDescWay":"3","dssRefImg":"3","dssDrawIcon":"3"}]  

这是我得json 数据
作者: felt    时间: 2014-8-7 21:58:04

wansgibo 发表于 2014-8-7 20:33
还是不行啊。

[{"dssTypeId":"2","quntUnitl":null,"quntUnitk":null,"quntUnitg":null,"quntUnitm":nu ...

loadData ( Array )  加载树形数据
loadList ( Array, idField, parentField )加载列表数据
你的数据又没children字段,是列表数据,请参考API操作




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