jQuery MiniUI

标题: treeselect后台读取数据显示出错 [打印本页]

作者: jissie丢    时间: 2014-4-17 10:49:20     标题: treeselect后台读取数据显示出错

本帖最后由 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;
我的页面效果是[attach]4321[/attach]
我换一种实现方式
<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");

实现效果[attach]4320[/attach]
作者: felt    时间: 2014-4-17 11:36:22

idfield="City_Id">>>>>valueField="City_Id"
作者: jissie丢    时间: 2014-4-17 13:48:01

felt 发表于 2014-4-17 11:36
idfield="City_Id">>>>>valueField="City_Id"

厉害, 解决了




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