zoukankan      html  css  js  c++  java
  • treeView

            /// <summary>
            /// 绑定父节点数据
            /// </summary>
            private void BindData()
            {
                //获取到父节点信息
                var parentNodes = ComRole.ComBill.GetDepartMentDendrogram(1, this.ComUserId);
                if (parentNodes.Any())
                {

                    foreach (var pNodes in parentNodes)
                    {
                        pNodes.ComUserInfo = new ComUserInfo();
                        TreeNode node = new TreeNode();
                        node.Text = pNodes.departmentName;
                        node.Value = pNodes.identify.ToString();
                        treeDepart.Nodes.Add(node);
                        BindChildData(node, Convert.ToInt64(pNodes.identify));
                    }
                }
                iframes.Attributes.Add("src", "ComDeptContentPage.aspx?id=170");
            }



            /// <summary>
            /// 绑定子节点
            /// </summary>
            /// <param name="parentId"></param>
            private void BindChildData(TreeNode nd, long parentId)
            {
                //获取子节点信息
                var childNodes = ComRole.ComBill.GetDepartMentDendrogram(parentId, this.ComUserId);
                if (childNodes.Any())
                {
                    foreach (var childNode in childNodes)
                    {
                        TreeNode tn = new TreeNode();
                        tn.Text = childNode.departmentName;
                        tn.Value = childNode.identify.ToString();
                        nd.ChildNodes.Add(tn);
                        BindChildData(tn, Convert.ToInt64(childNode.identify));
                    }
                }
            }

  • 相关阅读:
    iOS 字典转模型 KVC 实现
    iOS开发 滤镜的使用
    iOS开发 二维码生成
    iOS开发 iOS10兼容访问http
    Jmockit 使用小计 1.46
    springboot样例 pom与小花招
    react + antd html网页配置非框架
    Vue 设置 vue router 路径错误检查
    java 8 读取配置文件例子
    mysql 项目配置
  • 原文地址:https://www.cnblogs.com/Mancy/p/2504391.html
Copyright © 2011-2022 走看看