• easyUI 异步加载树


      $(function () {
                
            var selected = $('#depttree').tree('getSelected');
            $('#depttree').tree({
                checkbox: false,
                animate: true,
                url: '/Provider/HandlerCommon.ashx?method=getsessiontree',
                onClick: function (node) {
      
                }, onSelect: function (node) {
                   // deptid = node.id;
                },
                onExpand: function (node) {
                   // expandid = node.id;
                }, 
                onLoadSuccess: function (row, data) {
                
    
    
                }
            });
            });
     private string GetSessionTree(HttpContext context)
            {
                string parentid = context.Request["id"] == null ? "000" : context.Request["id"];
                StringBuilder sb = new StringBuilder();
                sb.Append("[");
                if (parentid.Length == 9)
                {
                    DataCondition<EntitySequenceDepartment.Field> conditsequencedepartment = new DataCondition<EntitySequenceDepartment.Field>();
                    conditsequencedepartment.Add("{0}='" + parentid + "'",EntitySequenceDepartment.Field.Sequence_Cur);
                    IList<EntitySequenceDepartment> SequenceDepartmentList = DbSequenceDepartment .ListView(conditsequencedepartment);
                    for (int i = 0; i < SequenceDepartmentList.Count; i++)
                    {
                        sb.Append("{"id":"" + SequenceDepartmentList[i].Sequence_Cur + "",");
                        sb.Append(""text":"" + SequenceDepartmentList[i].DepartmentName + "",");
                        sb.Append(""attributes":"" + SequenceDepartmentList[i].SeDepartment_Id + "",");
                        sb.Append(""state":"open" },");
                    }
    
                }
                else
                {
                    DataCondition<EntitySequence.Field> conditionchild = new DataCondition<EntitySequence.Field>();
                    conditionchild.Add("{0}='" + parentid + "'", EntitySequence.Field.Sequence_Parent);
                    IList<EntitySequence> SequenceList = DbSequence.ListView(conditionchild);
                   
                  
                    for (int i = 0; i < SequenceList.Count; i++)
                    {
                        sb.Append("{"id":"" + SequenceList[i].Sequence_Cur + "",");
                        sb.Append(""text":"" + SequenceList[i].Sequence_Name + "",");
                        sb.Append(""attributes":"" + SequenceList[i].Sequence_Id + "",");
    
                        if (CheckSequence(SequenceList[i].Sequence_Cur))
                        {
                            sb.Append(""state":"closed" },");
                        }
                        else
                        {
                            if (CheckSequenceDepartment(SequenceList[i].Sequence_Cur))
                            {
                                sb.Append(""state":"closed" },");
                            }
                            else
                            {
                                sb.Append(""state":"open" },");
                            }
                        }
    
                    }
                   
    
                }
                  sb.Remove(sb.Length - 1, 1);
                    sb.Append("]");
                return sb.ToString();
    
    
            }
    
  • 相关阅读:
    struts的ognl.NoConversionPossible错误
    hibernate many-to-one
    向网页中插入百度地图
    hibernate多对一单向配置
    PHP+MySQL按时间段查询记录代码
    iis无法启动的解决办法-卸掉KB939373补丁
    跳转回上一页代码
    QQ在线客服代码
    SSH(Struts2 + Hibernate + Spring)嵌入 KindEditor(KE)
    php从数据库选取记录形成列表(首页调用)
  • 原文地址:https://www.cnblogs.com/gwazy/p/9852615.html
Copyright © 2020-2023  润新知