点击按钮新建菜单项的函数该怎么写。

wlj3203 2009-10-29 08:48:50

function outlook() {
this.titlelist = new Array();
this.itemlist = new Array();
this.addtitle = addtitle;
this.additem = additem;
this.getbytitle = getbytitle;
this.getbyitem = getbyitem;
this.getdefaultnav = getdefaultnav;
}
function theitem(intitle, insort, inkey, inisdefault) {
this.sortname = insort;
this.key = inkey;
this.title = intitle;
this.isdefault = inisdefault;
}
function addtitle(intitle, sortname, inisdefault) {
outlookbar.itemlist[outlookbar.titlelist.length] = new Array();
outlookbar.titlelist[outlookbar.titlelist.length] = new theitem(intitle, sortname, 0, inisdefault);
return (outlookbar.titlelist.length - 1);
}
function additem(intitle, parentid, inkey) {
if (parentid >= 0 && parentid <= outlookbar.titlelist.length) {
insort = "item_" + parentid;
outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length] = new theitem(intitle, insort, inkey, 0);
return (outlookbar.itemlist[parentid].length - 1);
} else {
additem = -1;
}
// 导航栏配置文件
var outlookbar=new outlook();
var t;
t=outlookbar.addtitle('管理首页','管理首页',1)
outlookbar.additem('按列表模式显示',t,'../SerchReport?city=jiangsu')
outlookbar.additem('按图形模式显示',t,'../chartMode.jsp')

t=outlookbar.addtitle('任务管理','任务管理',1)
outlookbar.additem('新建查询任务',t,'../NewSerchTask.jsp')
outlookbar.additem('查询历史任务',t,'../SerchhistoryTask.jsp')
t=outlookbar.addtitle('运行中的任务','任务管理',1);
outlookbar.additem('任务1',t,'../taskInfo.jsp');

我想在点击按钮的时候才新建运行中的任务的菜单项 任务1 Onclick 调用的函数该怎么写?
...全文
61 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
李子做IT 2009-10-29
  • 打赏
  • 举报
回复
<input type="button" onclick="outlookbar.additem();"/>
wlj3203 2009-10-29
  • 打赏
  • 举报
回复
现在我就是点击一个按钮的时候 才执行outlookbar.additem('任务1',t,'../taskInfo.jsp'); 这句话,该怎么控制.......
jol_boy 2009-10-29
  • 打赏
  • 举报
回复
lz语言表达的能力实在太差!不明您的需求~~~~~

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧