예제 #1
0
        public ActionResult Menu()
        {
            DhtmlxMenu menu = new DhtmlxMenu();
            DhtmlxMenuContainerItem newType = new DhtmlxMenuContainerItem("new", "新建");

            newType.AddMenuItem(new DhtmlxMenuContainerItem("newType", "新建类别"));
            //newItem.AddMenuItem(new DhtmlxMenuContainerItem("newItem", "新建项目"));
            menu.AddItem(newType);
            //menu.AddItem(new DhtmlxMenuSeparatorItem("s1"));
            string str = menu.BuildDhtmlXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
예제 #2
0
        public ActionResult RoleMenu()
        {
            var        allRoles = roleRep.GetByCondition(r => true);
            DhtmlxMenu menu     = new DhtmlxMenu();

            foreach (Role role in allRoles)
            {
                menu.AddItem(new DhtmlxMenuContainerItem(role.Id.ToString() + "|" + role.Code, role.Name));
                menu.AddItem(new DhtmlxMenuSeparatorItem("s4"));
            }

            string str = menu.BuildDhtmlXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
예제 #3
0
        public ActionResult Menu()
        {
            DhtmlxMenu menu = new DhtmlxMenu();
            DhtmlxMenuContainerItem newItem = new DhtmlxMenuContainerItem("new", "新建");

            newItem.AddMenuItem(new DhtmlxMenuContainerItem("newMenCategory", "新建模块类别"));
            newItem.AddMenuItem(new DhtmlxMenuContainerItem("newMenu", "新建模块"));
            menu.AddItem(newItem);
            menu.AddItem(new DhtmlxMenuSeparatorItem("s1"));
            DhtmlxMenuContainerItem editItem = new DhtmlxMenuContainerItem("edit", "编辑");

            editItem.AddMenuItem(new DhtmlxMenuContainerItem("EditMenuCategory", "编辑模块类别"));
            editItem.AddMenuItem(new DhtmlxMenuContainerItem("DeleteMenuCategory", "删除模块类别"));
            menu.AddItem(editItem);

            string str = menu.BuildDhtmlXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }