SlickGrid

copy/paste issue

by Alex Azuero

HTML

<script src="https://rawgithub.com/Celebio/SlickGrid/master/lib/jquery-ui-1.8.16.custom.min.js"></script>
<script src="https://rawgithub.com/Celebio/SlickGrid/master/slick.core.js"></script>
<script src="https://rawgithub.com/Celebio/SlickGrid/master/plugins/slick.autotooltips.js"></script>
<script src="https://rawgithub.com/Celebio/SlickGrid/master/plugins/slick.cellrangedecorator.js"></script>
<script src="https://rawgithub.com/Celebio/SlickGrid/master/plugins/slick.cellrangeselector.js"></script>
<script src="https://rawgithub.com/Celebio/SlickGrid/master/plugins/slick.cellexternalcopymanager.js"></script>
<script src="https://rawgithub.com/Celebio/SlickGrid/master/plugins/slick.cellselectionmodel.js"></script>
<script src="https://rawgithub.com/Celebio/SlickGrid/master/lib/jquery.event.drag-2.2.js"></script>
<script src="https://rawgithub.com/Celebio/SlickGrid/master/slick.editors.js"></script>
<script src="https://rawgithub.com/Celebio/SlickGrid/master/slick.grid.js"></script>
<link rel="stylesheet" href="https://rawgithub.com/Celebio/SlickGrid/master/slick.grid.css">
<link rel="stylesheet" href="https://rawgithub.com/Celebio/SlickGrid/master/slick-default-theme.css">
	<div id="myGrid" style="width:300px;height:400px;"></div>

JavaScript

var RowNumberFormatter = function(row, cell, value, columnDef, dataContext) {
	    return row + 1;
	};

	var grid;
	var gridRows = 100;

	var data = [];

	var columns = [					   
				   {id:"rowNumber", name:"", field: "", editor:Slick.Editors.Text, formatter:RowNumberFormatter, behavior:"select", cssClass:"cell-selection", width:40, cannotTriggerInsert:true, resizable:false, unselectable:true, sortable:false},
	               {id:"A", name:"X", field: "A", editor:Slick.Editors.Text, sortable:false, width:120},
	               {id:"B", name:"Y", field: "B", editor:Slick.Editors.Text, width:120}
	];

	var options = {
		editable: true,
		enableAddRow: false,
		enableCellNavigation: true,
		asyncEditorLoading: false,
		autoEdit: true
	};
	
	var undoRedoBuffer = {
      commandQueue : [],
      commandCtr : 0,

      queueAndExecuteCommand : function(editCommand) {
        this.commandQueue[this.commandCtr] = editCommand;
        this.commandCtr++;
        editCommand.execute();
      },

      undo : function() {
        if (this.commandCtr == 0)
          return;

        this.commandCtr--;
        var command = this.commandQueue[this.commandCtr];

        if (command && Slick.GlobalEditorLock.cancelCurrentEdit()) {
          command.undo();
        }
      },
      redo : function() {
        if (this.commandCtr >= this.commandQueue.length)
          return;
        var command = this.commandQueue[this.commandCtr];
        this.commandCtr++;
        if (command && Slick.GlobalEditorLock.cancelCurrentEdit()) {
          command.execute();
        }
      }
	}
	
	var pluginOptions = {
    	clipboardCommandHandler: function(editCommand){ undoRedoBuffer.queueAndExecuteCommand.call(undoRedoBuffer,editCommand); },
	    includeHeaderWhenCopying : false
	  };

	function clickHandler()
	{			
		//data.sort(sortByFirstName);
		//grid.onRowsChanged.notify;
		console.log("logging!");
		document.forms["myform"].griddata.value =...