Func递归Easyui Tree
Func<int, List<EasyuiTree>> fun = null;
fun = i =>
{
return result.Where(c => c.ParentId == i).Select(c => new EasyuiTree
{
id = c.CategoryID,
text = c.CategoryName,
state = EasyuiEnum.open.ToString(),
attributes = null,
@checked = false,
children = result.Any(a => a.ParentId == c.CategoryID) ? fun(c.CategoryID) : null
}).ToList();
};

本文介绍了一种使用Func委托实现递归构造EasyUI Tree组件的方法。通过递归查询子节点并构建相应的EasyUI Tree对象,可以高效地展示层级结构的数据。
1773

被折叠的 条评论
为什么被折叠?



