
静态和动态之间的相互调用,无法互通2实现方式1,通过动态语言获取出数据,css对其隐藏, *** 作时让CSS设为显示,即可3实现方式2,利用jsajax动态语言, *** 作比较复杂,但也可以实现
希望可以帮到你望采纳谢谢
登录验证 , 然后 将你的菜单返回 , 格式无所谓 , 只要你最后能从JS中解析出来
将菜单加到一个toolbar上
设置菜单的事件
//下面是简单的摘子目前用的的一个例子/
顶部菜单
/
Extdefine('XRSpagebarTop', {
extend: 'ExttoolbarToolbar',
dock: "top",
border: "1 0 2 0",
initComponent: function () {
var me = this;
//这里是对菜单进行解析 , 因为我从后台返回来的是 列表 , 而不是一个树 , 所以需要解析成 菜单的格式
//参数$AdmingetMainMenu() 这个是从后台饭回来的数据的一个简单包装 , 在下面我一个样本
var mainMenu = thisparseMenu($AdmingetMainMenu());
meitems = mainMenu;
thiscallParent();
} ,
//解析成菜单格式的数据
parseMenu: function (menus) {
var me = this;
if (!(menus && menuslength > 0)) return false;
//根据parentid生成树
var map = {};
var rs = [];
Exteach(menus, function (n) {
nid = "mainmenu_" + nid;
ntext = nname;
//这里是设置点击事件的 , 通过bind , 不需要设置scope
nhandler = Extbind(meonClick, me);
//下面的只是生成一个菜单的数据格式
map[nid] = n;
//如果找到父节点
if (map["mainmenu_" + nparentid]) {
var pn = map["mainmenu_" + nparentid];
if (!pnmenu) {
pnhideOnClick = false;
pnmenu = {
items: []
};
}
if (nisSeparator == "1") nxtype = "menuseparator";
pnmenuitemspush(n);
} else {
if (nisSeparator == "1") nxtype = "tbseparator";
rspush(n);
}
}, this);
return rs;
},
//这是一个点击事件
onClick: function (menu, e) {
if (!menu) return;
//可以任意设置事件
alert(menutext);
//thisfireEvent('moduleclick', menu, 'menu');
}
});
//下面是个返回的菜单数据样本 , 是个列表
"mainMenu": [
{
"$id": "14",
"id": 53,
"name": "基础信息",
"code": "",
"menutype": null,
"module": "",
"moduleConfig": " ",
"method": " ",
"isWindow": null,
"url": null,
"iconCls": "ico_baseinfo",
"parentid": 1,
"path": "1,53",
"ix": 24,
"privilege": "6",
"isSeparator": 0,
"xtype": null,
"disabled": null,
"noprivilege": 0
},
{
"$id": "35",
"id": 54,
"name": "系统代码管理",
"code": "",
"menutype": null,
"module": "XRSbaseinfocodeList",
"moduleConfig": " ",
"method": " ",
"isWindow": null,
"url": null,
"iconCls": "ico_code",
"parentid": 53,
"path": "1,53,54",
"ix": 1,
"privilege": "7",
"isSeparator": 0,
"xtype": null,
"disabled": null,
"noprivilege": 0
},
{
"$id": "36",
"id": 55,
"name": null,
"code": null,
"menutype": null,
"module": null,
"moduleConfig": null,
"method": null,
"isWindow": null,
"url": null,
"iconCls": null,
"parentid": 53,
"path": "1,53,55",
"ix": 2,
"privilege": "7",
"isSeparator": 1,
"xtype": null,
"disabled": null,
"noprivilege": 0
},
{
"$id": "37",
"id": 57,
"name": "部门机构",
"code": "",
"menutype": null,
"module": "XRSbaseinfoorganizationList",
"moduleConfig": " ",
"method": " ",
"isWindow": null,
"url": null,
"iconCls": "ico_org",
"parentid": 53,
"path": "1,53,57",
"ix": 3,
"privilege": "8",
"isSeparator": 0,
"xtype": null,
"disabled": null,
"noprivilege": 0
},
{
"$id": "38",
"id": 58,
"name": "用户",
"code": "",
"menutype": null,
"module": "XRSbaseinfouserList",
"moduleConfig": " ",
"method": " ",
"isWindow": null,
"url": null,
"iconCls": "ico_user",
"parentid": 53,
"path": "1,53,58",
"ix": 4,
"privilege": "9",
"isSeparator": 0,
"xtype": null,
"disabled": null,
"noprivilege": 0
},
{
"$id": "39",
"id": 59,
"name": "角色",
"code": "",
"menutype": null,
"module": "XRSbaseinforoleList",
"moduleConfig": " ",
"method": " ",
"isWindow": null,
"url": null,
"iconCls": "ico_role",
"parentid": 53,
"path": "1,53,59",
"ix": 5,
"privilege": "10",
"isSeparator": 0,
"xtype": null,
"disabled": null,
"noprivilege": 0
}]
首先看是否加载连接数据库的引用没
其次如果是在别的主机上使用你自己写好的VBA,有时需要重新引用
最后看你的oracle数据库是否搭建完成,用SQLplus登陆查询下
以上就是关于数据库生成二级菜单全部的内容,包括:数据库生成二级菜单、Extjs中如何使用数据库中的数据,创建动态菜单、excel启用宏工具,vba以后无法连接oracle数据库了等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)