我正在使用struts2 jquery grid 3.1.0版本。我要求双击显示行详细信息。我使用以下代码显示已编辑的行。但是双击时对话框会显示一个空对话框。任何有关这方面的帮助将不胜感激。代码附在
下面 var parentSelRow = jQuery(gridFn.$id).jqGrid('getGridParam',
'selrow');
var grid = $(gridFn.$id);
var gridSub = $(gridFn.$id + "_" + parentSelRow + "_table");
gridSub.dblclick(function(e) {
var td = e.target;
var ptr = $(td, gridSub[0].rows).closest("tr.jqgrow");
if ($(ptr).length === 0) {
return false;
}
var ri = ptr[0].rowIndex;
var ci = $.jgrid.getCellIndex(td);
var rowId = $(ptr).attr("id");
alert(rowId);
var selectedRow = gridSub.jqGrid('getGridParam', ('selrow'));
if (selectedRow != null && selectedRow.length > 0) {
gridSub.jqGrid('editGridRow', rowId, {
editCaption : "View Record",
width : 660,
recreateForm : true,
recreateFilter : true,
viewPagerButtons : true,
onInitializeForm : gridFn.initializeViewForm,
beforeShowForm : gridFn.beforeViewForm,
afterShowForm : gridFn.afterViewForm,
onClose : gridFn.onCloseViewForm,
closeAfterAdd : true,
closeOnEscape : true,
errorTextFormat : gridFn.errorTextFormat}); }