【发布时间】:2014-02-25 10:10:38
【问题描述】:
我有带有编辑和添加表单的 jqGrid,问题是显示 jqGrid 的左侧,而不是窗口的中心,我尝试了不同的方式,但没有得到,这是我的代码..
$(document).ready(function () {
jQuery("#jQGridDemo").jqGrid({
url: 'http://localhost:52618/Sample/GetEmployeeDetails',
datatype: "json",
mtype: "POST",
colNames: ['Eno', 'Ename', 'City', 'Salary', 'Address', 'Actions'],
colModel: [
{ name: 'Eno', index: 'Eno', width: 120, stype: 'text', height: 90, editable: true },
{ name: 'Ename', index: 'Ename', width: 150, editable: true },
{ name: 'City', index: 'City', width: 150, editable: true },
{ name: 'Salary', index: 'Salary', width: 100, height: 120, editable: true },
{ name: 'Address', index: 'Address', width: 100, height: 120, hidden: true, editable: true, editrules: { edithidden: true }, hidedlg: true },
{
name: 'Actions', index: 'Actions', width: 100, height: 120, formatter: 'actions',
formatoptions: {
keys: true,
editformbutton: true,
}
},
],
rowNum: 10,
add: true,
addParams: { useFormatter: true },
mtype: 'Get',
loadonce: true,
pager: '#jQGridDemoPager',
viewrecords: true,
caption: "List Employee Details",
height: "230px",
add: true,
});
jQuery("#jQGridDemo").jqGrid('navGrid', "#jQGridDemoPager", {
add: true,
edit: false,
del: false
});
});
【问题讨论】:
-
我尝试过不同的方式.....你也应该发布这些。
-
[link][1] [1]: stackoverflow.com/questions/21846860/… 这很容易制作。检查给出的链接。