How to show row in view mode if action button is pressed in jqgrid if single click starts edit
jqGrid inline edit starts on single in click by onSelectRow event below.
Save and cancel action buttons are turned on.

Save or cancel button click does not end inline edit. Row remains in edit mode after clicking to those buttons.
It looks like button click causes onSelectRow event which re-starts inline edit.

How to end single click inline edit in clicked in save or cancel action button ?


    $(function () {
        var grid = $("#grid");
        grid.jqGrid({
              colModel: [{"name":"_actions","width":45,"formatter":"actions",
              "formatoptions":{"keys":true,"delbutton":false,"afterSave":function (rowID, response) {
                      cancelEditing($('#grid'));
                      aftersavefunc(rowID, response);
                }
    ,"onError":errorfunc
    ,"onEdit":function (rowID) {
           if (typeof (lastSelectedRow) !== 'undefined' && rowID !== lastSelectedRow)
                           cancelEditing($('#grid'));
                           lastSelectedRow = rowID;
           }
    }},
    ...
    },
    
           onSelectRow: function (rowID) {
            lastSelectedRow = rowID;
        $("tr#" + lastSelectedRow + " div.ui-inline-edit, " + "tr#" + lastSelectedRow + " div.ui-inline-del").hide();
        $("tr#" + lastSelectedRow + " div.ui-inline-save, " + "tr#" + lastSelectedRow + " div.ui-inline-cancel").show();
        $("#grid").jqGrid('editRow', lastSelectedRow );
      }
    }
    
    
    function cancelEditing(myGrid) {
        if (typeof lastSelectedRow !== "undefined") {
            myGrid.jqGrid('restoreRow', lastSelectedRow);
      var lrid = lastSelectedRow;
      $("tr#" + lrid + " div.ui-inline-edit").show();
      $("tr#" + lrid + " div.ui-inline-save, " + "tr#" + lrid + " div.ui-inline-cancel").hide();
        }
    }
    }


How to show row in view mode if action button is pressed in jqgrid if single click starts edit
===

jqGrid inline edit starts on single in click by onSelectRow event below.
Save and cancel action buttons are turned on.

Save or cancel button click does not end inline edit. Row remains in edit mode after clicking to those buttons.
It looks like button click causes onSelectRow event which re-starts inline edit.

How to end single click inline edit in clicked in save or cancel action button ?


    $(function () {
        var grid = $("#grid");
        grid.jqGrid({
              colModel: [{"name":"_actions","width":45,"formatter":"actions",
              "formatoptions":{"keys":true,"delbutton":false,"afterSave":function (rowID, response) {
                      cancelEditing($('#grid'));
                      aftersavefunc(rowID, response);
                }
    ,"onError":errorfunc
    ,"onEdit":function (rowID) {
           if (typeof (lastSelectedRow) !== 'undefined' && rowID !== lastSelectedRow)
                           cancelEditing($('#grid'));
                           lastSelectedRow = rowID;
           }
    }},
    ...
    },
    
           onSelectRow: function (rowID) {
            lastSelectedRow = rowID;
        $("tr#" + lastSelectedRow + " div.ui-inline-edit, " + "tr#" + lastSelectedRow + " div.ui-inline-del").hide();
        $("tr#" + lastSelectedRow + " div.ui-inline-save, " + "tr#" + lastSelectedRow + " div.ui-inline-cancel").show();
        $("#grid").jqGrid('editRow', lastSelectedRow );
      }
    }
    
    
    function cancelEditing(myGrid) {
        if (typeof lastSelectedRow !== "undefined") {
            myGrid.jqGrid('restoreRow', lastSelectedRow);
      var lrid = lastSelectedRow;
      $("tr#" + lrid + " div.ui-inline-edit").show();
      $("tr#" + lrid + " div.ui-inline-save, " + "tr#" + lrid + " div.ui-inline-cancel").hide();
        }
    }
    }

