<script type="text/javascript">
$.jgrid.no_legacy_api = true;
$.jgrid.useJSON = true;
$(document).ready(function () {
jQuery("#tOceanC_ds_list").jqGrid({
// add by default to avoid webmethod parameter conflicts
// add by default to avoid webmethod parameter conflicts
url: "Default.aspx?cmd=select",
datatype: "json",
colNames: ['BOQID', 'BOQType', 'Description', 'Quantity'],
colModel:[
{ name: "BOQID", hidden: true, index: "BOQID", jsonmap: "BOQID",search:true,key:true,editable:true },
{ name: "BOQType", summaryTpl: "{0}", editable: true, searchoptions: {}, index: "BOQType", width: 200, align: "center", jsonmap: "BOQType", searchoptions: {}},
//{ name: "Description", editable: true, index: "Description", width: 200, align: "center", jsonmap: "Description", search: true },
{ "editoptions": { dataInit: function (el) { setTimeout(function () { var ec = 'DatePicker1'; if (typeof (jQuery(el).datepicker) !== 'function') alert('JQDatePicker javascript not present on the page. Please, include jquery.jqDatePicker.min.js'); jQuery(el).datepicker(eval(ec + '_dpid')); }, 200); } }, "summaryTpl": "{0}", "editable": true, "edittype": "text", "searchoptions": { dataInit: function (el) { setTimeout(function () { var ec = 'DatePicker1'; if (typeof (jQuery(el).datepicker) !== 'function') alert('JQDatePicker javascript not present on the page. Please, include jquery.jqDatePicker.min.js'); jQuery(el).datepicker(eval(ec + '_dpid')); }, 200); } }, name: "Description", index: "Description" },
{ name: "Quantity", editable: true, index: "Quantity", width: 200, align: "center", jsonmap: "Quantity", search: true }
],
viewrecords: true, scrollrows: false, postBackUrl: "__doPostBack('#tOceanC_ds_list','jqGridParams')",
editDialogOptions: { editCaption: "Edit Dialog", resize: false, closeAfterEdit: true, processData: "Default.aspx", bSubmit: "Submit", bCancel: "Cancel Editing", modal: true, recreateForm: true, errorTextFormat: function (data) { return 'Error: ' + data.responseText } },
addDialogOptions: { recreateForm: true, errorTextFormat: function (data) { return 'Error: ' + data.responseText } },
delDialogOptions: { errorTextFormat: function (data) { return 'Error: ' + data.responseText } },
searchDialogOptions: {left:300,top:400,resize:false},viewRowDetailsDialogOptions: {},jsonReader: { id: "BOQID" },
rowNum: 10,
height: "60%",
rownumbers: true,
autowidth: true,
shrinkToFit: false,
rowList:[10,20,30,50,100],
pager: jQuery("#OceanC_pager"),
viewrecords: true,
multiselect: false,
sortorder: "desc",
caption:"List of Users",
editurl: "Default.aspx",
//serializeGridData: function (data) {
// return $.toJSON(data);
//},
jsonReader: { repeatitems : false, id: "0" }
});
jQuery("#tOceanC_ds_list").jqGrid("navGrid", "#OceanC_pager", { add: false, edit: true, del: true, search: true, view: true,reload:true}, {}, {}, {}, { multipleSearch: false }, jQuery('#tOceanC_ds_list').getGridParam('editDialogOptions'), jQuery('#tOceanC_ds_list').getGridParam('addDialogOptions'), jQuery('#tOceanC_ds_list').getGridParam('delDialogOptions'), jQuery('#tOceanC_ds_list').getGridParam('searchDialogOptions'), jQuery('#tOceanC_ds_list').getGridParam('viewRowDetailsDialogOptions')).bindKeys()
});
function customPhoto(cellVal, options, rowObject){
return "<img src='assets/img/" + cellVal + "' height='50' width='50' >";
}
</script>
editurl
不传递参数来编辑数据,如oper,del,edit,add
我希望editurl
将这些参数传递给代码,当我request.querystring["oper"]
返回空或r equest.querystring["del"]
它返回空
我使用的是asp.net webform 3.5 framework