在.net中如何动态加载easyUI中combotree的数据

躺着丿看天 2010-08-19 10:29:55
比如:

<select id="cc" class="easyui-combotree" url="aaa.json" style="width:200px;"></select>

但是我想aaa.json中展开时能够动态加载数据,如何实现?因为数据量大了点.或者有什么好的解决方案?
...全文
714 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
shelf0 2012-08-02
  • 打赏
  • 举报
回复
同求。。
中年张先生 2011-08-22
  • 打赏
  • 举报
回复
解决了不。。
我也愁啊。。。
怎么动态加载呢。
vvvwww521 2011-08-17
  • 打赏
  • 举报
回复
非常想知道啊!
hanxiao888888 2011-07-26
  • 打赏
  • 举报
回复
<%@ WebHandler Language="C#" Class="GetInfo" %>

using System;
using System.Web;
using System.Web.Script.Serialization;
using MySchool.BLL;
using MySchool.Models;
public class GetInfo : IHttpHandler {

public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
context.Response.Write(GetJson());
}
public static string GetJson()
{
string json = "[";
System.Collections.Generic.List<Person> persons=PersonManager.GetName();
foreach (var item in persons)
{
if (item != persons[persons.Count - 1])
{
json += GetJsonByModel(item) + ",";
}
else
{
json += GetJsonByModel(item);
}
}
json += "]";
json = json.Replace(",","\"");
return json;
}
public static string GetJsonByModel(Person p)
{
string json = "";
bool flag = false;
json = "{"
+ "'id':'" + p.Id + "',"
+ "'text':'" + p.Name + "',"
+ "'iconCls':'ok',"
+ "'children':";
if (!flag)
{
json += "null}";
}
else
{
json += "[{";
System.Collections.Generic.List<Person> list = PersonManager.GetName();
foreach (Person item in list)
{
if (item!=list[list.Count-1])
{
json += GetJsonByModel(item)+",";
}
else
{
json += GetJsonByModel(item);
}
}
json += "}]";

}
return json;

}
public bool IsReusable {
get {
return false;
}
}

}
slmuro 2011-07-12
  • 打赏
  • 举报
回复
我那时候弄的好像 是另外用JS函数 通过AJAX调用数据 重新绑定到上面。
骑猪看海 2011-07-12
  • 打赏
  • 举报
回复
我也想知道

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧