jQuery MiniUI

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

treeselect后台读取数据显示出错 [复制链接]

Rank: 2

跳转到指定楼层
楼主
发表于 2014-4-17 10:49:20 |只看该作者 |倒序浏览
本帖最后由 jissie丢 于 2014-4-17 11:03 编辑

请问我第一种实现效果上哪里出了问题?我想实现图片2的效果
<input id="txtCity" name="txtCity" class="mini-treeselect" url="../ybt_ajax/cityHandler.ashx?method=GetFatherList"
                        showtreeicon="true" textfield="City_Name" idfield="City_Id" parentfield="City_FatherId" resultastree="false"
                        showarrow="true" expandonnodeclick="true" emptyText="区域" style="width:120px;"/>

case "GetFatherList":
                    json="[{\"City_Id\":2,\"City_Name\":\"上海\",\"City_FatherId\":0},{\"City_Id\":1,\"City_Name\":\"北京\",\"City_FatherId\":0},{\"City_Id\":398,\"City_Name\":\"东城区\",\"City_FatherId\":1},{\"City_Id\":399,\"City_Name\":\"西城区\",\"City_FatherId\":1},{\"City_Id\":434,\"City_Name\":\"闵行\",\"City_FatherId\":2}]";
                    context.Response.Write(json);
                    break;
我的页面效果是
我换一种实现方式
<input id="txtCity" name="txtCity" class="mini-treeselect"
                        showtreeicon="true" textfield="City_Name" idfield="City_Id" parentfield="City_FatherId" resultastree="false"
                        showarrow="true" expandonnodeclick="true" emptyText="区域" style="width:120px;"/>

        var list =[{"City_Id":2,"City_Name":"上海","City_FatherId":0},{"City_Id":1,"City_Name":"北京","City_FatherId":0},{"City_Id":398,"City_Name":"东城区","City_FatherId":1},{"City_Id":399,"City_Name":"西城区","City_FatherId":1},{"City_Id":434,"City_Name":"闵行","City_FatherId":2}];
        var tree3 = mini.get("txtCity");
        tree3.loadList(list, "City_Id", "City_FatherId");

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

Rank: 8Rank: 8

沙发
发表于 2014-4-17 11:36:22 |只看该作者
idfield="City_Id">>>>>valueField="City_Id"

Rank: 2

板凳
发表于 2014-4-17 13:48:01 |只看该作者
felt 发表于 2014-4-17 11:36
idfield="City_Id">>>>>valueField="City_Id"

厉害, 解决了

Archiver|普加软件

GMT+8, 2024-11-27 03:48 , Processed in 1.037765 second(s), 11 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部