title: Enabling Save button on JQ Grid with InlineEditing and CellEdit
body: <p>Hi I have a Grid that is using cell edit and Inline editing. It saves to the ClientArray</p>
  
  <pre><code>$('#list').jqGrid({
      datatype: "local",
      colNames: ["Parameter Id", "Parameter Name", 'Parameter Value'],
      colModel: [
          { name: "Id", index: "Id", align: "left", key: true, editable: false,hidden:true, jmap: 0 },
          { name: "ParameterName", index: "ParameterName", align: "left", editable: false, jmap: 1 },
          { name: "ParameterValue", index: "ParameterValue", align: "left", editable: true, edittype: "text", editoptions: { maxlength: 100 }, editrules: {required: true }, jmap: 2 }
      ],
  
      pager: "#pager",
      rowNum: 100,
      rowList: [],
      pgbuttons: false,     // disable page control like next, back button
      pgtext: null,         // disable pager text like 'Page 0 of 10'
      viewrecords: true,   // disable current view record text like 'View 1-10 of 100'
      height: '100%',
      scrollOffset: 0,
      sortname: "Name",
      sortorder: "Asc",
      gridview: true,
      caption: 'Parameters',
      autowidth: true,
      hidegrid: false,
      loadonce: true,
      //beforeEditCell: function () {
      //    $("#list_ilsave").removeClass('ui-state-disabled');
      //    return;
      //},
      //afterEditCell: function (rowid, cellname, value, iRow, iCol) {
      //    $('#list').jqGrid('getCell', rowid, iCol).focus();
      //    return;
      //},
      width: totalWidth,
      cellEdit: true,
      cellsubmit: "clientArray"
  });
  
  $('#list').jqGrid('inlineNav', '#pager', {
          edit: false,
          add: false,
          del: false,
          save: true,
          savetext: 'Save',
          cancel: false
      });
  </code></pre>
  
  <p>When I edit a Cell the save button remains disabled. If I manually Enable the button in beforeCellEdit, the editable cell hasn't got focus until you select another cell. This behavior is only happening in IE.</p>
  
  <p>I have tried to fix both these issues individually in my commented out code, and  I have found that the loss of focus is caused by the line</p>
  
  <pre><code>$("#list_ilsave").removeClass('ui-state-disabled');
  </code></pre>
  
  <p>I tried placing this line in beforeEditCell and in afterEditCell and it causes the input field to loose focus. </p>
  
  <p>I was using JQ Grid 4.4.4 and I have tried updating to 4.6.0 after I read there were updates to Inline Editing after 4.4.4</p>
  
  <p><strong>UPDATE</strong>
  I have changed my grid to use onSelectRow</p>
  
  <pre><code>        onSelectRow: function (rowid) {
          var $grid = $('#list');
          var iRow = $("#" + rowid)[0].rowIndex;
  
          $grid.jqGrid('editRow', rowid, {
              keys: true,
              oneditfunc: function(rowid, response) {
                  var $saveButton = $("#list_ilsave");
  
                  if ($saveButton.hasClass('ui-state-disabled')) {
                      $saveButton.removeClass('ui-state-disabled');
                  }
  
                  markCellAsDirty(rowid, $grid);
                  return true;
              },
              successfunc: function() {
                  alert('success');
                  return true;
              },
              aftersavefunc: function() {
                  alert('after save');
                  return true;
              },
              errorfunc: function() {
                  alert('error');
                  return true;
              }
          });
      },
      cellsubmit: "clientArray"
  </code></pre>
  
  <p>But I can't get any of the editRow events to fire other than <code>oneditfunc</code>. I also have an issue with getting the changed cells.</p>
  
  <p>This method marks the cells as dirty / edited</p>
  
  <pre><code>function markCellAsDirty(rowid, grid) {
      $(grid.jqGrid("setCell", rowid, "ParameterValue", "", "dirty-cell"));
      $(grid[0].rows.namedItem(rowid)).addClass("edited");
  }
  </code></pre>
  
  <p>I try to get the edited cells as follows</p>
  
  <pre><code>var editedRows = $grid.getChangedCells('dirty');
  </code></pre>
  
  <p>Before posting editedRows in an AJAX method to my server.</p>