public NavMenu AddSubMenu(string _id, string _name, string _url, string _target)
 {
     NavMenu subMenu = new NavMenu();
     subMenu.Id = _id;
     subMenu.Name = _name;
     subMenu.NavUrl = _url;
     subMenu.Target = _target;
     return AddSubMenu(subMenu);
 }
        public NavMenu AddSubMenu(string _id, string _name, string _url, string _target)
        {
            NavMenu subMenu = new NavMenu();

            subMenu.Id     = _id;
            subMenu.Name   = _name;
            subMenu.NavUrl = _url;
            subMenu.Target = _target;
            return(AddSubMenu(subMenu));
        }
        public string getPath()
        {
            string path = this.Name;

            NavMenu pMenu = this.ParentMenu;

            while (pMenu != null)
            {
                path  = pMenu.Name + " >> " + path;
                pMenu = pMenu.ParentMenu;
            }

            return(path);
        }
 public NavMenu AddSubMenu(NavMenu subMenu)
 {
     subMenu.ParentMenu = this;
     subMenus.Add(subMenu);
     return(subMenu);
 }
Beispiel #5
0
 private TreeNode CreateMainItem(NavMenu menu, Accordion accordion)
 {
     var treePanel = new TreePanel();
     treePanel.ID = "tp" + menu.Id;
     treePanel.AutoScroll = true;
     treePanel.Collapsed = false;
     treePanel.CollapseFirst = true;
     treePanel.HideParent = false;
     treePanel.RootVisible = false;
     treePanel.Title = menu.Name;
     treePanel.Icon = Icon.ApplicationHome;
     treePanel.Listeners.Click.Handler = "e.stopEvent();loadPage(#{MainTabs},node)";
     var rootNode = new TreeNode(menu.Id, menu.Name, Icon.FolderHome);
     rootNode.Expanded = true;
     treePanel.Root.Add(rootNode);
     accordion.Items.Add(treePanel);
     return rootNode;
 }
Beispiel #6
0
 private void CreateSubItem(NavMenu menu, TreeNode mainNode)
 {
     foreach (NavMenu submenu in menu.SubMenus)
     {
         var subNode = new TreeNode(submenu.Id);
         subNode.Text = submenu.Name;
         SetIcon(submenu.Icon, submenu.IsCategory, subNode);
         subNode.Href = ResolveUrl(submenu.NavUrl);
         subNode.CustomAttributes.Add(new ConfigItem("isCategory", submenu.IsCategory.ToString(),
                                                     ParameterMode.Value));
         mainNode.Nodes.Add(subNode);
         CreateSubItem(submenu, subNode);
     }
 }
 public NavMenu AddSubMenu(NavMenu subMenu)
 {
     subMenu.ParentMenu = this;
     subMenus.Add(subMenu);
     return subMenu;
 }