var frozenColumns = [
{ name: 'GID', title: '', width: 40, align: 'center', hidden: true, frozen: true }, //主键必须加上,并且隐藏
{ name: 'GLC', title: '', width: 40, align: 'center', hidden: true, frozen: true },
{ name: 'SJTLBCODE', title: '', width: 40, align: 'center', hidden: true, frozen: true },
{ name: 'LC_ACTIVITYID', title: '', width: 40, align: 'center', hidden: true, frozen: true },
{
name: 'opt', title: '操作', width: 40, align: 'center', frozen: true,
formatter: function (value, rec, row) {
return "<a href=\"#\" class=\"alink\" οnclick=\"View2('" + row.GID + "','家庭信息查看',true);return false;\"><span style=\"color:#15428B\">查看</span></a>";
}
},
{ name: 'IFLAG', title: '完善', width: 40, align: 'center', hidden: true },
{
name: 'IFLAG', title: '完善', width: 40, align: 'center',
formatter: function (value) {
return getIcon(value);
}
}
];
var ids = [];
var fCount = 0;
var rows = $("#TList").jqGrid('getGridParam', 'selarrrow');
if (rows.length < 1) {
$.tipMessage('信息', '请选择要核对的数据!', 'info');
return false;
}
$.tipMessage('信息', String(rows.length).toString(), 'info');
var sqs = $("#Hid_Needsqs").val().toUpperCase();
if (sqs == 'TRUE') {
for (var i = 0; i < rows.length; i++) {
var rowDatda2 = $("#TList").getRowData(rows[i]);
if (!rowDatda2.STYPECODE > 0) {
$.tipMessage('信息', "您选择的数据中存在无授权书的的数据,不能提交核对!", 'warn');
return false;
}
}
}
for (var i = 0; i < rows.length; i++) {
var rowDatda = $("#TList").getRowData(rows[i]);
ids.push(rowDatda.GID);
}
var SJTLBCODE = rowDatda.SJTLBCODE;
var listval = ids;
if (listval.length > 0) {
parent.art.dialog({
title: '询问',
content: '确认核对这<font color=\"red\">' + listval.length + '</font>条数据吗?',
ok: function () {
var par = "action=hedui&listval=" + escape(listval) + "&SJTLBCODE=" + SJTLBCODE;
ajax(list_handleurl, par, function (jsonvalue) {
clearSelections(); //清空grid的选中项
$.tipMessage('警告', jsonvalue.data, 'warn'); //弹出消息
});
},
cancelVal: '关闭',
lock: true,
cancel: true
});
-----------------------2--------------------
var frozenColumns = [
{ name: 'GID', title: '', width: 40, align: 'center', hidden: true, frozen: true }, //主键必须加上,并且隐藏
{ name: 'GLC', title: '', width: 40, align: 'center', hidden: true, frozen: true },
{ name: 'SJTLBCODE', title: '', width: 40, align: 'center', hidden: true, frozen: true },
{ name: 'LC_ACTIVITYID', title: '', width: 40, align: 'center', hidden: true, frozen: true },
{
name: 'opt', title: '操作', width: 40, align: 'center', frozen: true,
formatter: function (value, rec, row) {
return "<a href=\"#\" class=\"alink\" οnclick=\"View2('" + row.GID + "','家庭信息查看',true);return false;\"><span style=\"color:#15428B\">查看</span></a>";
}
},
{ name: 'IFLAG', title: '完善', width: 40, align: 'center', hidden: true },
{
name: 'IFLAG', title: '完善', width: 40, align: 'center',
formatter: function (value) {
return getIcon(value);
}
}
];
var AuditColumns = [
{ name: 'SAUDITIDEA', title: '审核意见', width: 100, align: 'center', sortable: false }
];
var HeduiColumns = [
{
name: 'HD_STATE', title: '核对状态', width: 100, align: 'center',
formatter: function (value, rec, row) {
if (value == "1") {
return "已发起核对";
}
else if (value == "2") {
return "<a href=\"#\" class=\"alink\" οnclick=\"view_hdbg('" + row.GID + "')\"><span style=\"color:#15428B\">查看核对报告</span></a>";
}
else if (value == "4") {
return "无预警";
}
else {
return "";
}
}
}
];
var HeduiColumns1 = [
{
name: 'STYPECODE', title: '授权书', width: 40, align: 'center',
formatter: function (value) {
return getIconSQ(value);
}
}
];
//活动列
var paramhidType = $("#hidType").val().substring(0, 2);
var config = $("#hidSJK").val();
list_columns = frozenColumns;
var columns = GetActiveColumns(paramhidType, config);
//将动态列追加到列表上
var len = columns.length;
list_columns.push(HeduiColumns1[0]);
list_columns.push(HeduiColumns[0]);
for (var i = 0; i < len; i++) {
list_columns.push(columns[i]);
}
list_columns.push(AuditColumns[0]);
list_columns.push(HeduiColumns1[0]);
list_columns.push(HeduiColumns[0]);
此处 是将授权书和核对状态放到固定的列当中
效果如下: