Пример #1
0
        //private Accordion InitAccordionMenu()
        //{
        //    Accordion accordionMenu = new Accordion();
        //    accordionMenu.ID = "accordionMenu";
        //    accordionMenu.ShowBorder = false;
        //    accordionMenu.ShowHeader = false;
        //    leftRegion.Items.Add(accordionMenu);


        //    XmlDocument xmlDoc = XmlDataSource1.GetXmlDocument();
        //    XmlNodeList xmlNodes = xmlDoc.SelectNodes("/Tree/TreeNode");
        //    foreach (XmlNode xmlNode in xmlNodes)
        //    {
        //        if (xmlNode.HasChildNodes)
        //        {
        //            AccordionPane accordionPane = new AccordionPane();
        //            accordionPane.Title = xmlNode.Attributes["Text"].Value;
        //            accordionPane.Layout = Layout.Fit;
        //            accordionPane.ShowBorder = false;
        //            accordionPane.BodyPadding = "2px 0 0 0";
        //            accordionMenu.Items.Add(accordionPane);

        //            Tree innerTree = new Tree();
        //            innerTree.ShowBorder = false;
        //            innerTree.ShowHeader = false;
        //            innerTree.EnableIcons = true;
        //            innerTree.AutoScroll = true;
        //            innerTree.EnableSingleClickExpand = true;
        //            accordionPane.Items.Add(innerTree);

        //            XmlDocument innerXmlDoc = new XmlDocument();
        //            innerXmlDoc.LoadXml(String.Format("<?xml version=\"1.0\" encoding=\"utf-8\" ?><Tree>{0}</Tree>", xmlNode.InnerXml));

        //            // 绑定AccordionPane内部的树控件
        //            innerTree.NodeDataBound += treeMenu_NodeDataBound;
        //            innerTree.PreNodeDataBound += treeMenu_PreNodeDataBound;
        //            innerTree.DataSource = innerXmlDoc;
        //            innerTree.DataBind();

        //            //// 重新设置每个节点的图标
        //            //ResolveTreeNode(innerTree.Nodes);
        //        }
        //    }

        //    return accordionMenu;
        //}

        //private Tree InitTreeMenu()
        //{
        //    Tree treeMenu = new Tree();
        //    treeMenu.ID = "treeMenu";
        //    treeMenu.ShowBorder = false;
        //    treeMenu.ShowHeader = false;
        //    treeMenu.EnableIcons = true;
        //    treeMenu.AutoScroll = true;
        //    treeMenu.EnableSingleClickExpand = true;
        //    treeMenu.IFrameUrl = "vMenuUrl";
        //    treeMenu.IFrameName = "vMenuName";

        //    leftRegion.Items.Add(treeMenu);

        //    // 绑定 XML 数据源到树控件
        //    DataSet ds = dataBasic.GetUserTree(Request.Cookies["Cookies"].Values["UserGuid"].ToString());
        //    ds.Relations.Add("TreeRelation", ds.Tables[0].Columns["id"], ds.Tables[0].Columns["iFatherId"]);


        //    treeMenu.NodeDataBound += treeMenu_NodeDataBound;
        //    treeMenu.PreNodeDataBound += treeMenu_PreNodeDataBound;
        //    treeMenu.DataSource = ds;
        //    treeMenu.DataBind();

        //    //// 重新设置每个节点的图标
        //    //ResolveTreeNode(treeMenu.Nodes);

        //    return treeMenu;
        //}


        /// <summary>
        /// 树节点的绑定后事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeMenu_NodeDataBound(object sender, FineUI.TreeNodeEventArgs e)
        {
            string isNewHtml = GetIsNewHtml(e.XmlNode);

            if (!String.IsNullOrEmpty(isNewHtml))
            {
                e.Node.Text += isNewHtml;
            }

            // 如果仅显示最新示例 并且 当前节点不是子节点,则展开当前节点
            if (showOnlyNew && !e.Node.Leaf)
            {
                e.Node.Expanded = true;
            }
        }
Пример #2
0
        /// <summary>
        /// 树节点的绑定后事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeMenu_NodeDataBound(object sender, FineUI.TreeNodeEventArgs e)
        {
            // 是否叶子节点
            bool isLeaf = e.XmlNode.ChildNodes.Count == 0;

            //string isNewHtml = GetIsNewHtml(e.XmlNode);
            //if (!String.IsNullOrEmpty(isNewHtml))
            //{
            //    e.Node.Text += isNewHtml;
            //}

            if (isLeaf)
            {
                // 设置节点的提示信息
                e.Node.ToolTip = e.Node.Text;
            }
        }
Пример #3
0
        /// <summary>
        /// 树节点的绑定后事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeMenu_NodeDataBound(object sender, FineUI.TreeNodeEventArgs e)
        {
            // 是否叶子节点
            bool isLeaf = e.XmlNode.ChildNodes.Count == 0;

            string isNewHtml = GetIsNewHtml(e.XmlNode);

            if (!String.IsNullOrEmpty(isNewHtml))
            {
                e.Node.Text += isNewHtml;
            }

            if (isLeaf)
            {
                // 设置节点的提示信息
                e.Node.ToolTip = e.Node.Text;
            }

            // 如果仅显示最新示例 并且 当前节点不是子节点,则展开当前节点
            if (_showOnlyNew && !e.Node.Leaf)
            {
                e.Node.Expanded = true;
            }
        }
Пример #4
0
        /// <summary>
        /// 延时加载函数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        protected void TreeSelectDept_NodeLazyLoad(object sender, FineUI.TreeNodeEventArgs e)
        {
            DynamicAppendNode(e.Node);
            e.Node.Expanded = true;
        }