title: Wijmo override methods
body: <p>This is a piece of  <strong>jquery.wijmo.wijgrid.js</strong></p>
  
  <pre><code>(function ($) {
      "use strict";
      $.extend($.wijmo.wijgrid, {
          cellEditorHelper: function () {
              this.currentCellEditStart = function (grid, e) {
                  var result = false,
                      currentCell = grid.currentCell(),
                      view = grid._view(),
                      rowObj, args, $innerDiv, rowType;
  
                  if (currentCell._isValid() &amp;&amp; !currentCell._isEdit() &amp;&amp; (currentCell.column().dataIndex &gt;= 0)) {
                      rowObj = currentCell._row();
  
                      if (rowObj &amp;&amp; rowObj.length) {
                          rowType = view._getRowInfo(rowObj).type;
  
                          if (rowType &amp; $.wijmo.wijgrid.rowType.data) {
  
                              args = {
                                  cell: currentCell,
                                  event: e,
                                  handled: false
                              };
  
                              if (result = grid._trigger("beforeCellEdit", null, args)) { // todo
                                  if (!args.handled) {
                                      result = defaultBeforeCellEdit(grid, args);
                                  }
                              }
  
                              if (result) {
                                  currentCell._isEdit(true);
  
                                  if (grid.options.showRowHeader) {
                                      $innerDiv = $(rowObj[0].cells[0]).children("div.wijmo-wijgrid-innercell");
                                      if ($innerDiv.length) {
                                          $innerDiv.empty();
                                          $innerDiv.append($("&lt;div&gt;&amp;nbsp;&lt;/div&gt;").addClass("ui-icon ui-icon-pencil"));
                                      }
                                  }
                              }
                          }
                      }
                  }
  
                  return result;
              };
  
              this.currentCellEditEnd = function (grid, e) {
                  var currentCell = grid.currentCell(),
                      result = false,
                      view = grid._view(),
                      rowObj, rowType, escPressed, args, a, b,
                      domCell;
  
                  if (!currentCell._isValid() || !currentCell._isEdit()) {
                      return;
                  }
  
                  rowObj = currentCell._row();
                  if (rowObj &amp;&amp; rowObj.length) {
                      rowType = view._getRowInfo(rowObj).type;
  
                      if (!(rowType &amp; $.wijmo.wijgrid.rowType.data)) {
                          return result;
                      }
  
                      escPressed = (e &amp;&amp; e.which === $.ui.keyCode.ESCAPE);
  
                      if (!e || (!escPressed)) {
                          args = {
                              cell: currentCell,
                              value: undefined
                          };
  
                          if (result = grid._trigger("beforeCellUpdate", null, args)) {
                              if (args.value === undefined) {
                                  args.value = getCellValue(grid, currentCell); // get raw value from editor using the default implementation.
                              }
  
                              a = args.value; // new value
                              try {
                                  args.value = grid._parse(currentCell.column(), args.value); // try to parse raw value
                                  a = args.value;
                              } catch (ex) {
                                  args.value = a; // restore raw value
                              }
  
                              b = currentCell.value(); // old value
  
                              if (args.cell.column().dataType === "datetime") {
                                  if (a instanceof Date) {
                                      a = a.getTime();
                                  }
  
                                  if (b instanceof Date) {
                                      b = b.getTime();
                                  }
                              }
  
                              if (a !== b) { // value is changed
                                  // update datasource
                                  try {
                                      currentCell.value(args.value);
                                  } catch (ex) {
                                      result = false;
                                      grid._trigger("invalidCellValue", null, { cell: currentCell, value: args.value });
                                  }
  
                                  if (result) {
                                      grid._trigger("afterCellUpdate", null, { cell: currentCell });
                                  }
                              }
                          }
                      } else {
                          // ESC key
                          result = true;
                      }
  
                      if (result) {
                          args = {
                              cell: currentCell,
                              event: e,
                              handled: false
                          };
  
                          grid._trigger("afterCellEdit", null, args);
  
                          $(grid._view().focusableElement()).focus(); // move focus from editor to wijgrid before editor element will be deleted.
  
                          if (!args.handled) {
                              result = defaultAfterCellEdit(grid, args);
                          }
  
                          if (result) {
                              currentCell._isEdit(false);
                          }
  
                          if (grid.options.showRowHeader) {
                              $(rowObj[0].cells[0]).children("div.wijmo-wijgrid-innercell").html("&amp;nbsp;"); // remove ui-icon-pencil
                          }
  
                          window.setTimeout(function () {
                              if (!grid.destroyed) {
                                  //grid.element.focus();
                                  currentCell = grid.currentCell();
  
                                  if (args.cell.isEqual(currentCell) &amp;&amp; (domCell = currentCell.tableCell())) { // same cell?
                                      $(domCell).focus(); // restore focus
                                  }
                              }
                          }, 50);
                      }
                  }
  
                  return result;
              };
  
              // private
  
              function defaultBeforeCellEdit(grid, args) {
                  var leafOpt = args.cell.column(),
                      result = false,
                      value, $container, $input, len, kbEvent;
  
                  if (leafOpt.dataIndex &gt;= 0) {
                      value = args.cell.value();
                      result = true;
  
                      try {
                          $container = args.cell.container();
  
                          if (leafOpt.dataType === "boolean") {
                              $input = $container.children("input");
                              $input.focus();
                              if (args.event &amp;&amp; args.event.type === "keypress") {
                                  $input.one("keyup", function (e) {
                                      if (e.which === $.ui.keyCode.SPACE) {
                                          e.preventDefault();
                                          $input[0].checked = !value;
                                      }
                                  });
                              }
                          } else {
                              $input = $("&lt;input /&gt;")
                                  .attr("type", "text")
                                  .addClass("wijgridinput wijmo-wijinput ui-state-focus")
                                  .bind("keydown", grid, checkBoxOrInputKeyDown);
  
                              //the problem of inputing
                              $input.bind(($.support.selectstart ? "selectstart" : "mousedown"), function (event) {
                                  event.stopPropagation();
                              });
  
                              if (args.event &amp;&amp; args.event.type === "keypress" &amp;&amp; args.event.which) {
                                  $input.val(String.fromCharCode(args.event.which));
                              } else {
                                  switch (args.cell.column().dataType) {
                                      case "currency":
                                      case "number":
                                          if (value !== null) {
                                              $input.val(value); // ignore formatting
                                              break;
                                          }
                                          // fall through
                                      default:
                                          $input.val(grid._toStr(args.cell.column(), value));
                                          break;
                                  }
                              }
  
                              $container
                                  .empty()
                                  .append($input);
  
                              // move caret to the end of the text
                              len = $input.val().length;
                              new $.wijmo.wijgrid.domSelection($input[0]).setSelection({ start: len, end: len });
  
                              $input.focus();
  
                              if ($.browser.msie) {
                                  setTimeout(function () {
                                      $input.focus();
                                  }, 0);
                              }
  
                              // FF issue: text does not track to the new position of the caret
                              if ($.browser.mozilla &amp;&amp; document.createEvent &amp;&amp; $input[0].dispatchEvent) {
                                  kbEvent = document.createEvent("KeyboardEvent");
                                  kbEvent.initKeyEvent("keypress", false, true, null, false, false, false, false, 0, $.ui.keyCode.SPACE);
                                  $input[0].dispatchEvent(kbEvent);
                                  kbEvent = document.createEvent("KeyboardEvent");
                                  kbEvent.initKeyEvent("keypress", false, true, null, false, false, false, false, $.ui.keyCode.BACKSPACE, 0);
                                  $input[0].dispatchEvent(kbEvent);
                              }
                          }
                      }
                      catch (ex) {
                          alert(ex.message);
                          result = false;
                      }
                  }
  
                  return result;
              }
  
              function defaultAfterCellEdit(grid, args) {
                  var leafOpt = args.cell.column(),
                      result = false,
                      $container, cellValue, input,
                      rowInfo, view;
  
                  if (leafOpt.dataIndex &gt;= 0) {
                      result = true;
                      view = grid._view();
  
                      try {
                          $container = args.cell.container();
                          cellValue = grid._toStr(leafOpt, args.cell.value());
  
                          rowInfo = view._getRowInfo(grid._rows().item(args.cell.rowIndex()));
  
                          if (leafOpt.dataType === "boolean") {
                              input = $container.children("input");
  
                              if (cellValue === "true") {
                                  input.attr("checked", "checked");
                              }
                              else {
                                  input.removeAttr("checked");
                              }
                          }
                          else {
                              grid.cellFormatter.format($container, leafOpt, cellValue, rowInfo);
                          }
                      }
                      catch (ex) {
                          console.warn("defaultAfterCellEdit: " + ex.message);
                          result = false;
                      }
                  }
  
                  return result;
              }
  
              function checkBoxOrInputKeyDown(args) {
                  if (args.which === $.ui.keyCode.ENTER) { // stop editing when Enter key is pressed
                      var grid = args.data;
  
                      if (grid) {
                          grid._endEditInternal(args);
                          return false; // prevent submit behaviour.
                      }
                  }
              }
  
              function getCellValue(gridView, currentCell) {
                  var $input = currentCell.container().find(":input:first"),
                      result = null;
  
                  if ($input.length) {
                      result = ($input.attr("type") === "checkbox")
                          ? $input[0].checked
                          : $input.val();
                  }
  
                  return result;
              }
  
              // private *
          }
      });
  })(jQuery);
  </code></pre>
  
  <p>How can I override this private function <code>function defaultAfterCellEdit(grid, args)</code>? Thats because it's nested from cellEditorHelper.currentCellEditStart</p>
  
  <p>How can I override that only function without copy almost entire original file?</p>