Код:
function BindMainGrid (rowDataMain) {
отладчик;
$ grid = $ ("# GetpassTable");
$ Grid.jqGrid ({
loadError: function (xhr, status, error) {
предупреждение («ошибка загрузки: + ошибка);
},
colNames: [«Mail», «GetPassID», «IMNumber», «UserID», «Item Description», «AssetTag», «Unit», «Quanity», «Reason for Movement», «Requisitioner», «Для переноса» По "," Из местоположения "," Из дополнительного местоположения "," В местоположение "," В дополнительное местоположение "],
colModel: [
{ name: 'Mail', index: 'Mail', sorttype: 'text', width: '60px', formatter: RenderMail },
{ "name": "GetPassID", "index": "GetPassID", "width": "150", hidden: true },
{ "name": "IMNumber", "index": "IMNumber", "width": "150"},
{ "name": "UserID", "index": "UserID", "width": "150" },
{ "name": "Item_Description", "index": "Item_Description", "width": "300" },
{ "name": "AssetTag", "index": "AssetTag", "width": "500" },
{ "name": "Unit", "index": "Unit", "width": "150" },
{ "name": "Quanity", "index": "Quanity", "width": "150" },
{ "name": "Reason_For_Movement", "index": "Reason_For_Movement", "width": "350" },
{ "name": "Requisitioner", "index": "Requisitioner", "width": "200" },
{ "name": "ToBeCarriedBy", "index": "ToBeCarriedBy", "width": "150" },
{ "name": "FromLocation", "index": "FromLocation", "width": "150" },
{ "name": "FromSubLocation", "index": "FromSubLocation", "width": "150" },
{ "name": "ToLocation", "index": "ToLocation", "width": "150" },
{ "name": "ToSubLocation", "index": "ToSubLocation", "width": "150" },
],
data: rowDataMain,
datatype: "local",
editurl: 'Project Details',
gridview: true,
pgbuttons: true,
rowList: [10, 20, 30, 40],
rownum: 10,
pager: '#GetpassPager',
datapage: true,
viewrecords: true,
autowidth: true,
height: "280px",
loadtext: "Loading...",
scroll: false,
pageable: true,
pagerpos: 'center',
caption: "Get pass Generation",
multiselect: false,
loadonce: false,
forceFit: false,
ignoreCase: true,
jsonReader: {
page: function (obj) { return 1; },
total: function (obj) { return 1; },
records: function (obj) { return obj.d.length; },
root: function (obj) { return obj.d; },
repeatitems: false,
id: "0"
},
shrinkToFit: false,
loadComplete: function (data) {
},
}).navGrid("#GetpassPager", { edit: false, add: false, del: false }, {}, {}, {}, { modal: true, multipleSearch: true })
}
function RenderMail(cellValue, options, subrowData, rowObject) {
var radioHtml = '<input style="width:25px" type="Checkbox" value=' + cellValue + ' name="Checkid" onclick="chk(\'' + options.subgrid_id + '\')"></input>';
return radioHtml;
}
function chk (rowId) {
}