我遇到了一些奇怪的问题,我对控制器操作的 ajax 调用没有第二次调用。第一次调用它并且断点被击中。但第二次它甚至没有显示以前的值的视图。
我正在使用 jqgrid.ondblClickRow,我需要以 dilaog 的形式打开一个视图。
jgqGrid代码在这里...
ondblClickRow: function () {
getUserProfile();
},
和getUserProfile函数如下
function getUserProfile() {
var rowId = $("#userGrid").jqGrid('getGridParam', 'selrow');
if (rowId == null) {
clearUserDetailSection();
return;
}
var rowData = jQuery("#userGrid").getRowData(rowId);
userId = $(rowData.Userid)[0].innerText;
$("#ProfilePopUp").dialog({
autoOpen: false,
height: 500,
width: 1000,
modal: true
});
LoadRolesData(userId, RolesForUserUrl);
$('#ProfilePopUp').dialog('open');
return;
}
这里是 LoadRoleData 函数的代码。
```
function LoadRolesData(userId, getRolesForUserUrl) {
$("#RolesTable").jqGrid
({
url: getRolesForUserUrl,
postData: { userId: userId },
datatype: 'json',
mtype: 'Post',
colNames: ['Division', 'Roles'],
colModel: [
{
name: "DivisionNumber", width: 200, sortable: true, sorttype: "number", search: true, number: true, searchoptions: { sopt: ['eq', 'ne'] }, align: "center",
formatter: function () { return FormatGridCells("Barnes&Noble"); }
},
{
name: "RoleDesc", width: 350, sortable: true, sorttype: "text", search: true, searchoptions: { sopt: ['cn', 'nc', 'nu', 'nn'] },
formatter: function (cellvalue) { return FormatGridCells(cellvalue); }
}
],
jsonReader:
{
root: "rows",
records: "records",
repeatitems: false
},
rowNum: -1,
height: '100',
viewrecords: true,
emptyrecords: 'No records',
toppager: false,
sortable: false,
loadComplete: function () {
$("tr.jqgrow:odd").css("background", "#CCCCCC");
}
}).jqGrid('navGrid', '#RolesTable_toppager', { search: false, edit: false, add: false, del: false });
}
Can someone have any Idea, I need to use ondblClickRow event only. Help appreciated.