i am using jqgrid in my project there is requirement,when a cell is select in gridview different other fields in webpage will fill so i am using a web method that return a list but problem is that on cellclick,command is not going to aspx.cs page
<script type="text/javascript">
$(function () {
var appsurl = '<%=ConfigurationManager.AppSettings["localpath"].ToString() %>';
var urlpath = appsurl + 'GetAllLeaveAdjustmentRetirementView';
"use strict";
var oItemGrid = $("#UsersGrid");
oItemGrid.jqGrid({
url: urlpath,
mtype: "GET",
datatype: "json",
ajaxGridOptions: {
contentType: "application/json"
},
serializeGridData: function (data) {
return JSON.stringify(data);
},
colNames: ['','Application No.', 'Date', 'Employee Name', 'Department', 'Designation', 'Date Of Retirement',''],
colModel: [
{
name: 'enbl', index: 'enbl', width: 20, align: 'center',
formatter: 'checkbox', editoptions: { value: '1:0' },
formatoptions: { disabled: false }
},
{ name: 'RetirementProposalNo', index: 'RetirementProposalNo', width: 90 },
{ name: 'DateOfJoining', index: 'DateOfJoining', width: 90 },
{ name: 'EmployeeName', index: 'EmployeeName', width: 100 },
{ name: 'Department', index: 'Department', width: 120 },
{ name: 'Designation', index: 'Designation', width: 90 },
{ name: 'DateOfRetirement', index: 'DateOfRetirement', width: 90 },
{ name: 'EmpPorfessionalId', index: 'EmpPorfessionalId', hidden: true }
],
autowidth: true,
height: 'auto',
rowNum: 10,
rowList: [10, 20, 30],
pager: '#pager1',
sortname: 'Department',
loadonce: true,
viewrecords: true,
sortorder: "desc",
rownumbers: true,
onCellSelect: function (row, col, content, event) {
Id = jQuery("#UsersGrid").jqGrid('getCell', row, 'EmpPorfessionalId');
FillDetails(Id);
},
jsonReader: {
root: "d"
}
});
jQuery("#UsersGrid").jqGrid('navGrid', '#pager1', { edit: false, add: false, del: false }, {}, {}, {}, { multipleSearch: true, multipleGroup: true, showQuery: true, closeAfterSearch: true });
});
function FillDetails(Id) {
alert("amit");
alert(Id);
debugger;
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "HRMS_LeaveAdjustmentView.aspx/FillDetails",
data: '{Id : "' + Id + '" }',
dataType: "json",
success: function (data) {
$.each(data, function (index, emprs) {
$('#ContentPlaceHolder1_lblFinalDecision').val(emprs.FinalDecission);
$('#ContentPlaceHolder1_lblChargesHandedFrom').val(emprs.ChargesHandedOverFrom);
$('#ContentPlaceHolder1_lblRetirementProposalNo').val(emprs.RetirementProposalNo);
$('#ContentPlaceHolder1_lblRetirementProposalDate').val(emprs.RetirementProposalDate);
$('#ContentPlaceHolder1_lblRetirementDate').val(emprs.DateofRetirement);
$('#ContentPlaceHolder1_lblJobType').val(emprs.JobType);
$('#ContentPlaceHolder1_lblDepartment').val(emprs.DepartmentName);
$('#ContentPlaceHolder1_lblDesignation').val(emprs.DesignationName);
$('#ContentPlaceHolder1_lblAppointmentDate').val(emprs.DateOfAppointment);
$('#ContentPlaceHolder1_lblScaleCode').val(emprs.ScaleCode);
});
},
failure: function (response) {
alert(response.d);
}
});
}
function OnSuccess(response) {
alert("done");
}
</script>
and my aspx.cs page is like this,i have a web method that return a list
[WebMethod]
public static List<Details> FillDetails(int Id)
{
}