获取页面请求参数
var keyValue = $.request("keyValue");
数据表格
function pageInit() {
var $gridList = $("#gridList");根据<table>生成jquery对象
$gridList.dataGrid({数据表格数据源和列信息
url: '@Url.Content("~/ProductManage/TProdChkPBD/GetGridJson")?keyValue=' + keyValue,
datatype: "json",
height: $(window).height() - 96,
colModel: [
{ label: "主键", name: "F_Id", hidden: true, key: true },
{ label: "产品ID", name: "F_ProductId", width: 70, align: 'left', hidden: true },
{ label: "编制日期", name: "MakeTime", width: 70, align: 'left', formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' } },
{ label: '创建人', name: 'F_CreatorUserId', width: 70, align: 'left',
formatter: function (cellvalue, options, rowObject) {
return top.clients.user[cellvalue] == null ? "" : top.clients.user[cellvalue].fullname;
}
},
{ label: '最后修改时间', name: 'F_LastModifyTime', width: 100, align: 'left', formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' } },
{
label: '最后修改人', name: 'F_LastModifyUserId', width: 70, align: 'left',
formatter: function (cellvalue, options, rowObject) {
return top.clients.user[cellvalue] == null ? "" : top.clients.user[cellvalue].fullname;
}
}
],
pager: "#gridPager",
sortname: 'F_CreatorTime asc desc',排序
viewrecords: true
});
}
点击方法,和reloadGrid触发
$("#btn_search").click(function () {
$gridList.jqGrid('setGridParam', {
postData: { keyword: $("#txt_keyword").val() },
}).trigger('reloadGrid');
});
开启新页面
function btn_add() {
$.modalOpen({
id: "Form1",
title: "新增明细",
url: '@Url.Content("~/ProductManage/TProdChkPBD/Form")',
width: "700px",
height: "510px",
callBack: function (iframeId) {
top.frames[iframeId].submitForm();
}
});
}