title: How to set focus to grid after delete in jqgrid
body: <p>jqGrid toolbar and inline delete buttons are used to delete rows.</p>
  
  <p>On delete command delete dialog appears. After delete is confirmed or cancelled, grid will not get focus. Mouse click in grid is required to make keyboard navigation to work in grid.</p>
  
  <p>How to set focus to grid after delete or if delete was cancelled so that additional mouse click is not required ?</p>
  
  <p>delete button in toolbar:</p>
  
  <pre><code>        $.extend($.jgrid.del, {
              top: window.innerHeight/2-100,  
              left: window.innerWidth/2-120,
              closeOnEscape: true,
              errorTextFormat: function (response) { 
                clearModeless();
                return decodeErrorMessage(response.responseText, '', '');
                },
              reloadAfterSubmit: false,
              afterShowForm: function($form) {
                  var form = $form.parent()[0];
  
                  $("#dData",form).attr("tabindex","1000");
                  $("#eData",form).attr("tabindex","1001");
                  setTimeout(function() {
                      $("#dData",form).focus(); 
                  },50);
              }
             });
  
  
             $grid.jqGrid("navGrid", "#grid_toppager", { 
  
              search:  true,
              del: true,
              add: true,
              view: true,
              edit: true
            }, 
  
            {       url: '/erp/Grid/Edit?_entity=Klient'},
  
         {        url: '/erp/Grid/Add?_entity=Klient' },
  
          { url: '/erp/Grid/Delete?_entity=Klient',
  
            beforeShowForm: function(form) {
              var selected = $grid.jqGrid('getGridParam','selarrrow');
              $("td.delmsg",form).html( 'Rows '+selected.length +'&lt;br/&gt;' +
                   'Delete?' );
              }
          }
  );
  </code></pre>
  
  <p>Delete button in column:'</p>
  
  <pre><code>             colModel: [{"name":"_actions","formatter":"actions","viewable":false,"formatoptions":{"editbutton":true,"keys":true,"onSuccess":function (jqXHR) { jqXHRFromOnSuccess=jqXHR;return true;}
  ,"afterSave":function (rowId) {
    var data = $.parseJSON(jqXHRFromOnSuccess.responseText);
  $grid.jqGrid('setRowData', rowId, { Kood: data.PrimaryKeyValues[0] }); 
  cancelEditing($grid);afterGridSaveFunc(rowId,jqXHRFromOnSuccess);jqXHRFromOnSuccess=null; 
  updateButtonState($grid);
  }
  ,"restoreAfterError":false,"onError":errorfunc
  ,"extraparam":{"_dokdata":FormData
  },"afterRestore":function () {
            updateButtonState($grid);
          }
  ,"onEdit":onInlineEdit
  ,"delbutton":true,"delOptions":{"url":"Delete","afterComplete":function (response, postdata, formid) { summarefresh($grid); }
  }}},
  </code></pre>