function commitCurrentEdit() {
      var item = getDataItem(activeRow);
      var column = columns[activeCell];
      var evt;

      if (currentEditor) {
        if (currentEditor.isValueChanged()) {
          var validationResults = currentEditor.validate();

          if (validationResults.valid) {
            if (activeRow < getDataLength()) {
              assert(item);
              evt = self.onCellChange;
            } else {
              item = item || {};
              evt = self.onAddNewRow;
            }
            var editCommand = {
              grid: self,
              row: activeRow,
              cell: activeCell,
              item: item,
              column: column,
              editor: currentEditor,
              serializedValue: currentEditor.serializeValue(),
              prevSerializedValue: serializedEditorValue,
              execute: function h_exec_edit_cmd_f() {
                this.appliedValue = this.serializedValue;
                this.editor.applyValue(item, this.appliedValue);
                updateCell(this.row, this.cell);
                this.notify();
              },
              undo: function h_undo_edit_cmd_f() {
                this.appliedValue = this.prevSerializedValue;
                this.editor.applyValue(item, this.appliedValue);
                updateCell(this.row, this.cell);
                this.notify();
              },
              notify: function h_notify_edit_cmd_f() {
                trigger(evt, this);
              }
            };

            if (options.editCommandHandler) {
              options.editCommandHandler(item, column, editCommand);
            } else {
              editCommand.execute();
            }
            makeActiveCellNormal();

            // check whether the lock has been re-acquired by event handlers
            return !getEditorLock().isActive();
          } else {
            // Re-add the CSS class to trigger transitions, if any.
            assert(activeCellNode);
            var $activeCellNode = $(activeCellNode);
            $activeCellNode.removeClass("invalid");
            $activeCellNode.outerWidth();  // force layout
            $activeCellNode.addClass("invalid");

            var e = new Slick.EventData();
            var retval = trigger(self.onValidationError, {
              row: activeRow,
              cell: activeCell,
              item: item,
              column: column,
              editor: currentEditor,
              prevSerializedValue: serializedEditorValue,

              cellNode: activeCellNode,
              validationResults: validationResults
            }, e);
            if (e.isHandled()) {
              return retval;
            }

            currentEditor.focus();
            assert(document.activeElement !== document.body);
            return false;
          }
        }

        makeActiveCellNormal();
      }
      return true;
    }
// IEditor implementation for the editor lock
IEditor implementation for the editor lock
IEditor implementation for the editor lock
function commitCurrentEdit() {
      var item = getDataItem(activeRow);
      var column = columns[activeCell];
      var evt;
      if (currentEditor) {
        if (currentEditor.isValueChanged()) {
          var validationResults = currentEditor.validate();
          if (validationResults.valid) {
            if (activeRow < getDataLength()) {
              assert(item);
              evt = self.onCellChange;
            } else {
              item = item || {};
              evt = self.onAddNewRow;
            }
            var editCommand = {
              grid: self,
              row: activeRow,
              cell: activeCell,
              item: item,
              column: column,
              editor: currentEditor,
              serializedValue: currentEditor.serializeValue(),
              prevSerializedValue: serializedEditorValue,
              execute: function h_exec_edit_cmd_f() {
                this.appliedValue = this.serializedValue;
                this.editor.applyValue(item, this.appliedValue);
                updateCell(this.row, this.cell);
                this.notify();
              },
              undo: function h_undo_edit_cmd_f() {
                this.appliedValue = this.prevSerializedValue;
                this.editor.applyValue(item, this.appliedValue);
                updateCell(this.row, this.cell);
                this.notify();
              },
              notify: function h_notify_edit_cmd_f() {
                trigger(evt, this);
              }
            };
            if (options.editCommandHandler) {
              options.editCommandHandler(item, column, editCommand);
            } else {
              editCommand.execute();
            }
            makeActiveCellNormal();
            return !getEditorLock().isActive();
          } else {
            assert(activeCellNode);
            var $activeCellNode = $(activeCellNode);
            $activeCellNode.removeClass("invalid");
            $activeCellNode.outerWidth();  
            $activeCellNode.addClass("invalid");
            var e = new Slick.EventData();
            var retval = trigger(self.onValidationError, {
              row: activeRow,
              cell: activeCell,
              item: item,
              column: column,
              editor: currentEditor,
              prevSerializedValue: serializedEditorValue,
              cellNode: activeCellNode,
              validationResults: validationResults
            }, e);
            if (e.isHandled()) {
              return retval;
            }
            currentEditor.focus();
            assert(document.activeElement !== document.body);
            return false;
          }
        }
        makeActiveCellNormal();
      }
      return true;
    }
function commitCurrentEdit ( ) { var item = getDataItem ( activeRow ) ; var column = columns [ activeCell ] ; var evt ; if ( currentEditor ) { if ( currentEditor . isValueChanged ( ) ) { var validationResults = currentEditor . validate ( ) ; if ( validationResults . valid ) { if ( activeRow < getDataLength ( ) ) { assert ( item ) ; evt = self . onCellChange ; } else { item = item || { } ; evt = self . onAddNewRow ; } var editCommand = { grid : self , row : activeRow , cell : activeCell , item : item , column : column , editor : currentEditor , serializedValue : currentEditor . serializeValue ( ) , prevSerializedValue : serializedEditorValue , execute : function h_exec_edit_cmd_f ( ) { this . appliedValue = this . serializedValue ; this . editor . applyValue ( item , this . appliedValue ) ; updateCell ( this . row , this . cell ) ; this . notify ( ) ; } , undo : function h_undo_edit_cmd_f ( ) { this . appliedValue = this . prevSerializedValue ; this . editor . applyValue ( item , this . appliedValue ) ; updateCell ( this . row , this . cell ) ; this . notify ( ) ; } , notify : function h_notify_edit_cmd_f ( ) { trigger ( evt , this ) ; } } ; if ( options . editCommandHandler ) { options . editCommandHandler ( item , column , editCommand ) ; } else { editCommand . execute ( ) ; } makeActiveCellNormal ( ) ; return ! getEditorLock ( ) . isActive ( ) ; } else { assert ( activeCellNode ) ; var $activeCellNode = $ ( activeCellNode ) ; $activeCellNode . removeClass ( "invalid" ) ; $activeCellNode . outerWidth ( ) ; $activeCellNode . addClass ( "invalid" ) ; var e = new Slick . EventData ( ) ; var retval = trigger ( self . onValidationError , { row : activeRow , cell : activeCell , item : item , column : column , editor : currentEditor , prevSerializedValue : serializedEditorValue , cellNode : activeCellNode , validationResults : validationResults } , e ) ; if ( e . isHandled ( ) ) { return retval ; } currentEditor . focus ( ) ; assert ( document . activeElement !== document . body ) ; return false ; } } makeActiveCellNormal ( ) ; } return true ; }
IEditor implementation for the editor lock
IEditor implementation for the editor lock
// check whether the lock has been re-acquired by event handlers // Re-add the CSS class to trigger transitions, if any. // force layout