JavaScript
var data = {"DOCS": [
{"ConfigId":1,"Documents":"A", "DocsReceived":true, "Comments":"", "NA":"", "DocGroup":"Maine"},
{"ConfigId":2, "Documents":"B", "DocsReceived":true, "Comments":"", "NA":"N", "DocGroup":"NewJersey"},
{"ConfigId":3, "Documents":"C", "DocsReceived":true, "Comments":"", "NA":"R", "DocGroup":"Maine"},
{"ConfigId":4, "Documents":"G", "DocsReceived":true, "Comments":"", "NA":"R", "DocGroup":"Virginia"},
{"ConfigId":5, "Documents":"G", "DocsReceived":true, "Comments":"", "NA":"R", "DocGroup":"Alabama"},
{"ConfigId":6, "Documents":"D", "DocsReceived":true, "Comments":"", "NA":"R", "DocGroup":""},
{"ConfigId":7, "Documents":"Q", "DocsReceived":true, "Comments":"", "NA":"R", "DocGroup":""}
]},
previouslyselectedRow;
$.extend($.fn.fmatter, {
dynamicText: function (cellvalue, options, rowObject) {
if (cellvalue == 'R') {
return 'Received';
} else if (cellvalue == 'N') {
return 'NA';
} else {
return '';
}
}
});
$.extend($.fn.fmatter.dynamicText, {
unformat: function (cellValue, options, elem) {
debugger;
var text = $(elem).text();
return text === ' ' ? '' : text;
}
});
$('#preclosing').jqGrid({
datatype: 'local',
data: data.DOCS,
colNames: ['', 'Documents Received', 'Comments', 'NA', 'DocGroup'],
colModel: [
{ name: 'Documents', index: 'Documents', align: 'left', sortable: false, editable: false, width: 20 },
{ name: 'DocsReceived', index: 'DocsReceived', align: 'center', sortable: false, editable: true, edittype: 'checkbox', editoptions: { value: "True:False" }, formatter: "checkbox", width: 140 },
{ name: 'Comments', index: 'Comments', align: 'center', sortable: false, editable: true, edittype: "textarea", editoptions: { rows: "3", cols: "16" }, width: 180 },
{ name: 'NA', index: 'NA', editable: true, formatter: 'dynamicText',...