step 1
<li generator="step1" style="display: inline-block;">
<a style="display:block; height:34px;" class="oe_menu_toggler" id="MaintenanceMenu">
Maintenance
</a>
</li>
step 2
<div generator="step2" id="QuotationsSubMenu" class="oe_secondary_menu" style="display: none;" data-menu-parent="104">
<%@ include file="quotationSubMenu.html" %>
</div id="QuotationsSubMenu">
step 3
$("#PurchaseOrdersMenu").click(function () {SubMenu("PurchaseOrdersSubMenu");})
step 4
function SubMenu(pSubMenuName){ //fsubmenu
var Menus="1_SubMenu,2_SubMenu,";
aMenus=Menus.split(",");
for (x in aMenus){
$("#"+aMenus[x]).css("display","none");
}
$("#"+pSubMenuName).css("display","block");
}
when no permission , delete item
var authorize='<%=Request.Cookies("ForeMostReportMenuPermission")%>';
var authorizes=authorize.split(",")
$(function() {
$( "a" ).each(function (i) {
s=$(this).text();
//if(s.indexOf(']')>=0){alert(s);}
for (x in authorizes){if (s.indexOf(authorizes[x])>0 || s.indexOf(']')>=0)
{this.style.color = "black";
}
}
});
$( "a" ).each(function (i) {
if (this.style.color!="black"){
this.href="removeIt"
$(this).remove();
}
});
$("li:empty").remove();
});
沒有留言:
張貼留言