我希望当我根据当前行的部门ID选择行来显示另一个包含数据的网格但是" Onselectrow"当我选择任何行
时没有响应 $(document).ready(function () {
$("#DeptInsertionMode").val(true);
CreateDialogForm();
$("#GridList").jqGrid({
datatype: "json",
url: '<%: Url.Action("GetAllDepartments", "Departments") %>',
editurl: '',
colNames: ['DeptId', 'Departments', '', ''],
colModel: [{ name: 'DeptId', index: 'DeptId', align: 'center', hidden: true },
{ name: 'DeptName', index: 'DeptName' },
{ name: 'Editlink', index: 'Editlink', formatter: 'showlink', formatoptions: {
baseLinkUrl: 'javascript:',
showAction: "UpdateDept('", addParam: "');"
}
},
{ name: 'Deletelink', index: 'Deletelink', formatter: 'showlink', formatoptions: {
baseLinkUrl: 'javascript:',
showAction: "RemoveDept('",
addParam: "');"
}
}],
pager: '#paginator',
gridview: true,
sortname: 'DeptId',
sortorder: 'desc',
width: '300',
height: '500',
caption: "Departments List",
viewrecords: false,
//multiselect: true,
rowNum: 20,
rowList: [5, 10, 20, 50],
onSelectRow: function (rowIndex) {
var departmenId = $(this).jqGrid().getCell(rowIndex, 'DeptId');
var url = '<%: Url.Action("GetCoursesByDept", "Departments") %>?deptId = ' + departmenId;
$("#CoursesList").jqGrid().setGridParam({ url: url }).trigger("reloadGrid");
}
});