Flexigrid右键菜单为什么显示不出来
简单做了一个Flexigrid测试,数据装载是没什么问题,右键菜单却怎么也出不来,右击打开的都是IE的菜单,不是说Flexigrid支持右键菜单的吗,问题出在什么地方
<script type="text/javascript">
$(document).ready(function () {
var maiheight = document.documentElement.clientHeight;
var w = $("#content_right").width() - 5;
var gh = $("#content_right").height() - 86;
$("#grdProList").flexigrid
({
url: 'post4.jsp',//得到JSON数据的URL
dataType: 'json',
colModel: [
{display: '数据操作', name: 'ID', sortable: true, width: 80, align: 'center' },
{ display: '职位名称', name: 'NAME', sortable: true, width: 150, align: 'center' },
{ display: '标准职位编号', name: 'STANDARDID', sortable: true, width: 80, align: 'center' },
{ display: '标准职位名称', name: 'STANDARDNAME', sortable: true, width: 100, align: 'center' },
{ display: '排序规则', name: 'ORDERNUM', sortable: true, width: 150, align: 'center' },
{ display: '备注', name: 'BZ', sortable: true, width: 60, align: 'center' }
],
searchitems: [
{ display: '姓名', name: 'NAME', isdefault: true, operater: "like" },
{ display: '职位分类', name: 'JOBNAME', operater: "=" }
],
ShowToggleCol: true,
singleSelect: true,
sortname: 'ID',
sortorder: 'asc',
usepager: true,
striped: true,
title: '企业设置职位信息',
useRp: true,
rp: 20,
usepager: true,
showTableToggleBtn: true,
showcheckbox: false,
rowhandler: contextmenu,//开启右键菜单
width: 600,
height: 'auto',
pagestat: '显示 {from} 到 {to}, 共 {total} 条',
procmsg: '请等待数据正在加载中 …',
nomsg: '没有数据',
onError: '查询出错,请刷新'
});
function toExcel() {//导出excel
preview();
}
function contextmenu(row) {//右键菜单对应方法
var menu = { width: 150, items: [
{ text: "查看", icon: "css/images/add.png", alias: "contextmenu-view", action: contextMenuItem_click },
{ text: "编辑", icon: "css/images/add.png", alias: "contextmenu-edit", action: contextMenuItem_click },
{ text: "删除", icon: "css/images/add.png", alias: "contextmenu-delete", action: contextMenuItem_click },
{ text: "刷新", icon: "css/images/add.png", alias: "contextmenu-reflash", action: contextMenuItem_click }
]
};
function contextMenuItem_click(target) {
var id = $(target).attr("id").substr(3);
var cmd = this.data.alias;
var ch = $.browser.msie ? target.ch : target.getAttribute("ch");
var cell = ch.split("_FG$SP_");
if (cmd == "contextmenu-view") {
alert("编辑,产品编号=" + id);
}
else if (cmd == "contextmenu-edit") {
//alert("编辑,产品编号=" + id);
location = '/UnitPosition/Edit/' + id;
}
else if (cmd == "contextmenu-delete") {
var name = cell[11];
if (confirm("你确认要删除工作经历信息 [" + name + "] 吗?")) {
//alert("删除,产品编号=" + id);
location = '/UnitPosition/Delete/' + id;
}
}
else {
$("#grdProList").flexReload();
}
}
$("#grdProList").contextmenu(menu);
}
function toolbarItem_onclick(cmd, pid) {
if (cmd == "Add") {
alert("cmd add aaais excuted" + pid);
}
else if (cmd == "Delete") {
alert("cmd Delete is excuted");
}
}
});
</script>
<table id="grdProList" style="display: none;"></table>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论