看这里http://blog.csdn.net/u013628152/article/details/42474927
我就用了这种方法,只要从数据库读取图片的路径就可以了
//添加新的手风琴风格菜单 function addMenu(data, sysName) {var menuList = "" //回圈全部模组菜单讯息$.each(data, function (i, objOne) {menuList = "" //回圈某个模组下所有菜单讯息$.each(objOne.MenuInfo, function (j, objTwo) {if (objTwo.PackageUrl != "") {menuList += " " + objTwo.MenuName + "" }else {menuList += " " + objTwo.MenuName + "" }}) menuList += " " $('#divMenuDetail').accordion('add', {title: " + objOne.MenuModelName + "", //菜单模组名称content: menuList, //本模组菜单清单selected: false}) }) var pp = $('#divMenuDetail').accordion('panels') var t = pp[0].panel('options').title $('#divMenuDetail').accordion('select', t) }这是我自己用的easyUI动态生成两层菜单前台JS方法你需要用ajax去后台抓出两层菜单传到前台,objOne是第一层,objTwo是第二层,参考一下var width = $(window).width()-80var height = $(window).height()-120
stView_layout = $('#stView_layout').layout({
width: width,
height: height
})
station_view = $('#stationView').window({
title: '测站导航',
left:50,
top:80,
width: width,
modal: false,
shadow: false,
closed: true,
height: height,
onResize:function(w,h){
if(stView_treegrid){
stView_treegrid.treegrid({
width:w-20,
height:h-260
})
}
}
})
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)