publicTIM 2012-12-21
ContextMenu:右键菜单
参考示例:ContextMenu:右键菜单
创建ContextMenu
<ulid="contextMenu"class="mini-contextmenu">
<li>
<span>操作</span>
<liiconCls="icon-new"onclick="onItemClick">新建</li>
<liclass="separator"></li>
<liiconCls="icon-add"onclick="onItemClick">增加</li>
<liiconCls="icon-edit"onclick="onItemClick">修改</li>
<liiconCls="icon-remove"onclick="onItemClick">删除</li>
</li>
<liclass="separator"></li>
<liiconCls="icon-open">打开</li>
<liiconCls="icon-remove">关闭</li>
</ul>
Javascript处理
functiononItemClick(e){
varitem=e.sender;
alert(item.getText());
}
window.onload=function(){
$("#region1").bind("contextmenu",function(e){
varmenu=mini.get("contextMenu");
menu.showAtPos(e.pageX,e.pageY);
returnfalse;
});
}