- 注册时间
- 2014-4-3
- 最后登录
- 2014-5-29
- 阅读权限
- 10
- 积分
- 133
- 精华
- 0
- 帖子
- 32
|
本帖最后由 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");
实现效果 |
|