2

我正在使用 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});     }
4

0 回答 0