Razor View, master page
Still not much to say, directly on the code
<ul class= "Sidebar-menu" > @for (int i = 0; i < Mlist.count; i++) {if (mlist[i). Fatherid = = 0) {mclist = Getchild (mlist[i). ModuleID, mlist);<!--A collection of level two menus--> <li class= "treeview" ><a href= "#" ><i class= "FA Fa-folder-o "></i><span> @mList [i]. Modulename</span><i class= "fa fa-angle-left pull-right" ></i></a><!--level menu--> &L
T;ul class= "Treeview-menu" > @for (int j = 0; J < Mclist.count; J +)//two-level loop { if (mclist[j). Fatherid = = 41//If CRM then enter this loop {mslist = Getchild (mclist[j). ModuleID, mlist); <!--level Three menu collection--> <li><a href= "javascript:void (0);" Data-id= "@mCList [j]. ModuleID "><i class=" fa fa-share "></i> @mCList [j]. Modulename<i class= "fa fa-angle-left pull-right" ></i></a><!--level two dishesSingle--> <ul class= "Treeview-menu" > @for (int k = 0; k < Mslist.count; k + +)//Level three menu Loop {if (! String.IsNullOrEmpty (Mslist[k]. Roteurl)) {<li><a href= "@Url. Content (mslist[k). Roteurl)? cid= @mSList [K]. ModuleID "Data-id=" @mSList [K]. ModuleID "><i class=" fa fa-circle-o "></i> @mSList [K].
Modulename</a></li> <!--level three menu--> i++; else {<li><a href= "javascript: void (0) "data-id=" @mSList [K]. ModuleID "><i class=" fa fa-circle-o "></i> @mSList [K].
Modulename</a></li> <!--level three menu--> i++;
}} </ul> </li> i++; else//Not CRM enters this {if (!) String.IsNullOrEmpty (Mclist[j]. Roteurl)) {<li><a href= "@Url. Content (MCLIST[J). Roteurl)? cid= @mCList [j]. ModuleID "Data-id=" @mCList [j]. ModuleID "><i class=" fa fa-circle-o "></i> @mCList [j].
Modulename</a></li> <!--level two menu--> i++; else {<li><a href= "javascript:void (0);" data-id= "@mC LIST[J]. ModuleID "><i class=" fa fa-circle-o "></i> @mCList [j].
Modulename</a></li> <!--level two menu--> i++;
}} </ul> </li>}} </ul>
Here's the point.
$.widget.bridge (' UIButton ', $.ui.button);
var _url = $.geturlparam ("cid");
$ (". Sidebar-menu li a"). each (function () {//Reserved menu open Status
var _id = $ (this). Data ("id");
if (_id = = _url) {
$ (this). Parent (). Parent (): Show ();
}
});
$ (". Sidebar-menu li a"). Click (function () {
$ (this). AddClass ("");
})
};
Ways to get Menu parameters
(function ($) {
$.geturlparam = function (name) {
var reg = new RegExp (^|&) + name + = ([^&]*) (&| $)"); Constructs an object with a regular expression with a target parameter
var r = window.location.search.substr (1). Match (reg);//Match target parameter
if (r!= null) {
Return unescape (r[2]); Returns the parameter value
} else {return
null;}}}
) (JQuery);
Effect chart
The above is a small series for everyone to bring the bootstrap Level 3 menu style, support master page retention open State implementation of the whole content, I hope that we support cloud-Habitat Community ~