protected void InitWebsite(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode, Window x) { ds = mWebSite.GetList(""); System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]); //过滤ParentID,得到当前的所有子节点 dvTree.RowFilter = "[ParentID] = '" + ParentID + "'"; foreach (DataRowView Row in dvTree) { FineUI.TreeNode Node = new FineUI.TreeNode(); Node.Text = Row["WEBNAME"].ToString(); Node.NodeID = Row["id"].ToString(); Node.EnableCheckEvent = true; Node.Expanded = true; if (Node.NodeID != "A8C9876A-7ECB-495C-836A-EC69143A63DE") { //Node.OnClientClick = x.GetShowReference("modify.aspx?id=" + Node.NodeID, "修改菜单",550,450); Node.EnableClickEvent = true; Node.Expanded = true; } Node.Expanded = false; if (pNode == null) { Node.Expanded = true; Node.EnableClickEvent = true; treelist.Nodes.Add(Node); } else { Node.Expanded = true; pNode.Nodes.Add(Node); } InitWebsite(Row["id"].ToString(), treelist, Node, x);//再次递归 } }
protected void InitMainWithCheckBoxValue(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode) { ds = mm.GetList(""); System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]); //过滤ParentID,得到当前的所有子节点 dvTree.RowFilter = "[ParentID] = '" + ParentID + "'"; foreach (DataRowView Row in dvTree) { FineUI.TreeNode Node = new FineUI.TreeNode(); Node.Text = Row["MainName"].ToString(); Node.NodeID = Row["id"].ToString(); Node.Icon = GetIcon(Row["MainIcon"].ToString()).Icon; Node.EnableCheckBox = true; Node.Expanded = false; Node.EnableCheckEvent = true; DataSet dt = new DataSet(); dt = manage.GetList(" ROLEID= '" + Request["ID"].ToString() + "' AND MAINID ='" + Node.NodeID + "'"); if (dt.Tables[0].Rows.Count == 1) { Node.Checked = true; } if (pNode == null) { Node.Expanded = true; treelist.Nodes.Add(Node); } else { pNode.Nodes.Add(Node); } InitMainWithCheckBoxValue(Row["id"].ToString(), treelist, Node);//再次递归 } }
protected void InitDictionary(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode, Window x) { ds = mDict.GetList(""); System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]); //过滤ParentID,得到当前的所有子节点 dvTree.RowFilter = "[ParentID] = '" + ParentID + "'"; foreach (DataRowView Row in dvTree) { FineUI.TreeNode Node = new FineUI.TreeNode(); Node.Text = Row["DictionaryName"].ToString(); Node.NodeID = Row["id"].ToString(); Node.Target = Row["DictionaryValue"].ToString(); Node.EnableCheckEvent = true; if (Node.NodeID != "2abe5d4e-3c71-43c0-83b0-a4e2b560aeb0") { //Node.OnClientClick = x.GetShowReference("modify.aspx?id=" + Node.NodeID, "修改菜单",550,450); Node.EnableClickEvent = true; } Node.Expanded = false; if (pNode == null) { Node.Expanded = true; Node.EnableClickEvent = true; treelist.Nodes.Add(Node); } else { pNode.Nodes.Add(Node); } InitDictionary(Row["id"].ToString(), treelist, Node, x);//再次递归 } }
protected void InitAccountMain(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode) { ds = mm.GetList(""); System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]); //过滤ParentID,得到当前的所有子节点 dvTree.RowFilter = "[ParentID] = '" + ParentID + "'"; foreach (DataRowView Row in dvTree) { FineUI.TreeNode Node = new FineUI.TreeNode(); Node.Text = Row["MainName"].ToString(); Node.NodeID = Row["id"].ToString(); Node.Expanded = true; if (pNode == null) { Node.Expanded = true; treelist.Nodes.Add(Node); } else { pNode.Nodes.Add(Node); } InitAccountMain(Row["id"].ToString(), treelist, Node);//再次递归 } }
protected void InitWebsite(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode) { ds = mWebSite.GetList(""); System.Data.DataView dvTree = new System.Data.DataView(ds.Tables[0]); //过滤ParentID,得到当前的所有子节点 dvTree.RowFilter = "[ParentID] = '" + ParentID + "'"; foreach (DataRowView Row in dvTree) { FineUI.TreeNode Node = new FineUI.TreeNode(); Node.Text = Row["WEBNAME"].ToString(); Node.NodeID = Row["id"].ToString(); Node.Expanded = false; Node.EnableCheckEvent = true; if (pNode == null) { Node.Expanded = true; Node.EnableCheckEvent = true; treelist.Nodes.Add(Node); } else { pNode.Nodes.Add(Node); } InitWebsite(Row["id"].ToString(), treelist, Node);//再次递归 } }
public void AddTree(FineUI.Tree pcx, string ParentID, FineUI.TreeNode pNode) { btnUserName.Text = Session["AccountName"].ToString(); dv = GetMainListByAccountID(Session["AccountID"].ToString(), ParentID); //dv = manage.GetUserMainList(ParentID, "f7f510c1-d10f-4bf4-ad13-941808a0d5ae"); System.Data.DataView dvTree = new System.Data.DataView(dv.Tables[0]); //过滤ParentID,得到当前的所有子节点 dvTree.RowFilter = "[ParentID] = '" + ParentID + "'"; foreach (DataRowView Row in dvTree) { FineUI.TreeNode Node = new FineUI.TreeNode(); Node.Text = Row["MainName"].ToString(); Node.Target = Row["MainURL"].ToString();//Row["SystemURL"].ToString(); ; Node.Icon = GetIcon(Row["MainIcon"].ToString()).Icon; Node.Expanded = true; if (Node.Target != "#") { Node.Expanded = true; Node.OnClientClick = mainTabStrip.GetAddTabReference(Node.Text, Node.Target, Node.Text, IconHelper.GetIconUrl(GetIcon(Row["MainIcon"].ToString()).Icon), true); Node.Icon = GetIcon(Row["MainIcon"].ToString()).Icon; } pNode.Nodes.Add(Node); AddTree(pcx, Row["id"].ToString(), Node);//再次递归 } }
protected void TreeMenu_NodeCheck(object sender, TreeCheckEventArgs e) { if (!e.Node.Leaf) { CheckTreeNode(e.Node.Nodes, e.Checked); } else { FineUI.Tree tree = e.Node.TreeInstance; foreach (FineUI.TreeNode node in tree.Nodes) { if (node.Target == e.Node.Target) { node.Checked = true; } } } }
protected void InitDictionaryWithCheckBox(string ParentID, FineUI.Tree treelist, FineUI.TreeNode pNode, string ID) { ds = mDict.GetList(""); DataView dvTree = new DataView(ds.Tables[0]); //过滤ParentID,得到当前的所有子节点 dvTree.RowFilter = "[ParentID] = '" + ParentID + "'"; foreach (DataRowView Row in dvTree) { FineUI.TreeNode Node = new FineUI.TreeNode(); Node.Text = Row["DictionaryName"].ToString(); Node.NodeID = Row["id"].ToString(); Node.Target = Row["DictionaryValue"].ToString(); Node.EnableCheckEvent = true; if (ID != null) { //dv = mrm.GetList(" roleid = '" + ID + "'"); //if (dv.Tables[0].Rows.Count > 0) //{ // for (int i = 0; i < dv.Tables[0].Rows.Count; i++) // { // if (Node.NodeID == dv.Tables[0].Rows[i]["mainid"].ToString()) // { // Node.Checked = true; // } // } //} } Node.EnableCheckBox = true; Node.Expanded = false; if (pNode == null) { Node.Expanded = true; treelist.Nodes.Add(Node); } else { pNode.Nodes.Add(Node); } InitDictionaryWithCheckBox(Row["id"].ToString(), treelist, Node, ID);//再次递归 } }
public static FineUI.Tree loadTreeMenu(FineUI.Tree tvMenu, List <applicationhierarchyDto> applicationHierarchys) { if (applicationHierarchys.Count > 0) { var parents = applicationHierarchys.FindAll(p => p.i_ParentId == -1); foreach (var parent in parents) { FineUI.TreeNode parentNode = new FineUI.TreeNode(); parentNode.Text = parent.v_Description; parentNode.AutoPostBack = true; parentNode.EnableCheckBox = true; parentNode.NodeID = parent.i_ApplicationHierarchyId.ToString(); tvMenu.Nodes.Add(parentNode); loadTreeSubMenu(ref parentNode, parent.i_ApplicationHierarchyId, applicationHierarchys); } } tvMenu.ExpandAllNodes(); return(tvMenu); }
public static FineUI.Tree loadTreeMenuAuthorized(FineUI.Tree tvMenu, List <AutorizationList> applicationHierarchys) { if (applicationHierarchys.Count > 0) { var parents = applicationHierarchys.FindAll(p => p.I_ParentId == -1); foreach (var parent in parents) { FineUI.TreeNode parentNode = new FineUI.TreeNode(); parentNode.Text = parent.V_Description; parentNode.NodeID = parent.I_ApplicationHierarchyId.ToString(); //parentNode.NavigateUrl = string.IsNullOrEmpty(parent.V_Form) ? "" : parent.V_Form; parentNode.ToolTip = parent.V_Description; tvMenu.Nodes.Add(parentNode); loadTreeSubMenuAuthorized(ref parentNode, parent.I_ApplicationHierarchyId, applicationHierarchys); } } tvMenu.ExpandAllNodes(); return(tvMenu); }
private Tree InitTreeMenu() { Tree treeMenu = new Tree(); treeMenu.ID = "treeMenu"; treeMenu.EnableArrows = true; treeMenu.ShowBorder = false; treeMenu.ShowHeader = false; treeMenu.EnableIcons = false; treeMenu.AutoScroll = true; BuildTree(App_Com.Sys_User.GetSys_Menu(), "", treeMenu, null); Region2.Items.Add(treeMenu); return treeMenu; }
private Accordion InitAccordionMenu() { Accordion accordionMenu = new Accordion(); accordionMenu.ID = "accordionMenu"; accordionMenu.EnableFill = true; accordionMenu.ShowBorder = false; accordionMenu.ShowHeader = false; Region2.Items.Add(accordionMenu); AccordionPane accordionPane; DataTable dt = App_Com.Sys_User.GetSys_Menu(); foreach (DataRow dr in dt.Select("IsNull(PID,'')=''", "RID")) { accordionPane = new AccordionPane(); accordionPane.Title = dr["MenuName"].ToString(); accordionPane.Layout = Layout.Fit; accordionPane.ShowBorder = false; accordionPane.BodyPadding = "2px 0 0 0"; accordionMenu.Items.Add(accordionPane); Tree treeMenu = new Tree(); treeMenu.EnableArrows = true; treeMenu.ShowBorder = false; treeMenu.ShowHeader = false; treeMenu.EnableIcons = false; treeMenu.AutoScroll = true; BuildTree(dt, dr["RID"].ToString(), treeMenu, null); accordionPane.Items.Add(treeMenu); } return accordionMenu; }
/// <summary> /// 创建树菜单 /// </summary> /// <param name="menus"></param> /// <returns></returns> private Tree InitTreeMenu(List<Menu> menus) { Tree treeMenu = new Tree(); treeMenu.ID = "treeMenu"; treeMenu.EnableArrows = true; treeMenu.ShowBorder = false; treeMenu.ShowHeader = false; treeMenu.EnableIcons = false; treeMenu.AutoScroll = true; regionLeft.Items.Add(treeMenu); // 生成树 ResolveMenuTree(menus, null, treeMenu.Nodes); // 展开第一个树节点 treeMenu.Nodes[0].Expanded = true; return treeMenu; }
/// <summary> /// 创建手风琴菜单 /// </summary> /// <param name="menus"></param> /// <returns></returns> private Accordion InitAccordionMenu(List<Menu> menus) { Accordion accordionMenu = new Accordion(); accordionMenu.ID = "accordionMenu"; accordionMenu.EnableFill = true; accordionMenu.ShowBorder = false; accordionMenu.ShowHeader = false; regionLeft.Items.Add(accordionMenu); foreach (var menu in menus.Where(m => m.Parent == null)) { AccordionPane accordionPane = new AccordionPane(); accordionPane.Title = menu.Name; accordionPane.Layout = Layout.Fit; accordionPane.ShowBorder = false; accordionPane.BodyPadding = "2px 0 0 0"; accordionMenu.Items.Add(accordionPane); Tree innerTree = new Tree(); innerTree.EnableArrows = true; innerTree.ShowBorder = false; innerTree.ShowHeader = false; innerTree.EnableIcons = false; innerTree.AutoScroll = true; accordionPane.Items.Add(innerTree); // 生成树 ResolveMenuTree(menus, menu, innerTree.Nodes); } return accordionMenu; }
private FineUI.Tree InitTreeMenu() { FineUI.Tree treeMenu = new FineUI.Tree(); treeMenu.ID = "treeMenu"; treeMenu.EnableArrows = true; treeMenu.ShowBorder = false; treeMenu.ShowHeader = false; treeMenu.EnableIcons = false; treeMenu.AutoScroll = true; Region2.Items.Add(treeMenu); treeMenu.DataSource = XmlDataSource1; treeMenu.DataBind(); foreach (var node in treeMenu.Nodes) { node.IconUrl = "/icon/vs_aspx.png"; } return treeMenu; }
//private bool _singleClickExpand = false; ///// <summary> ///// 单击可切换节点的折叠展开状态 ///// </summary> //[Category(CategoryName.OPTIONS)] //[DefaultValue(false)] //[Description("单击可切换节点的折叠展开状态")] //public bool SingleClickExpand //{ // get // { // return _singleClickExpand; // } // set // { // _singleClickExpand = value; // } //} #endregion #region private DataBindRow ///// <summary> ///// 绑定行的值 ///// </summary> //public void DataBindRow() //{ // #region old code // //// 如果没有初始化Values,则初始化 // //if (Values == null) // //{ // // GridColumnCollection columns = _grid.Columns; // // // 计算每列的值 // // Values = new object[columns.Count]; // // ExtraValues = new object[columns.Count]; // // for (int i = 0, count = columns.Count; i < count; i++) // // { // // Values[i] = columns[i].GetColumnValue(this); // // } // // // 计算DataKeys的值 // // if (_grid.DataKeyNames != null) // // { // // string[] keyNames = _grid.DataKeyNames; // // DataKeys = new object[keyNames.Length]; // // for (int i = 0, count = keyNames.Length; i < count; i++) // // { // // DataKeys[i] = GetPropertyValue(keyNames[i]); // // } // // } // // //// CheckBoxField需要特殊处理 // // //for (int i = 0, count = columns.Count; i < count; i++) // // //{ // // // CheckBoxField cbField = columns[i] as CheckBoxField; // // // if (cbField != null) // // // { // // // cbField.IniValues(); // // // } // // //} // //} // #endregion //} #endregion #region GetPropertyValue ///// <summary> ///// 取得属性的值 ///// </summary> ///// <param name="rowObj"></param> ///// <param name="propertyName"></param> ///// <returns></returns> //public object GetPropertyValue(string propertyName) //{ // //return ObjectUtil.GetPropertyValue(_dataItem, propertyName); //} #endregion #region old code //internal TreeNode AddNode() //{ // TreeNode node = new TreeNode(); // Nodes.Add(node); // return node; //} #endregion #region ReadXmlAttributes internal void ReadXmlAttributes(XmlAttributeCollection attributes, Tree tree) { foreach (XmlAttribute attribute in attributes) { string name = attribute.Name; if (tree != null && tree.Mappings.Count > 0) { name = tree.GetXmlAttributeMappingTo(name); } SetPropertyValue(name, attribute.Value); } }
private Accordion InitAccordionMenu() { string rightstr = BaseRightStr; Accordion accordionMenu = new Accordion(); accordionMenu.ID = "accordionMenu"; accordionMenu.EnableFill = true; accordionMenu.ShowBorder = false; accordionMenu.ShowHeader = false; Region2.Items.Add(accordionMenu); foreach (sys_Menu m in sysMenuList.Where(p => p.PId == "0").OrderBy(p => p.SortIndex).ToList()) { if (!rightstr.Contains(m.MenuCode + "-0")) continue; AccordionPane accordionPane = new AccordionPane(); accordionPane.Title = m.MenuName; accordionPane.Layout = Layout.Fit; accordionPane.ShowBorder = false; accordionPane.BodyPadding = "2px 0 0 0"; accordionPane.IconUrl = m.Ico; accordionMenu.Items.Add(accordionPane); Tree innerTree = new Tree(); innerTree.EnableArrows = true; innerTree.ShowBorder = false; innerTree.ShowHeader = false; innerTree.EnableIcons = false; innerTree.AutoScroll = true; accordionPane.Items.Add(innerTree); CreateNode(m.Id, innerTree.Nodes, rightstr); } return accordionMenu; }