function cutOrCopyAction(sourceRanges, cutMode, toClipboard) {
      assert(Array.isArray(sourceRanges));

      // make sure to clone (shallow) the range set as any subsequent selection action will echo into _copiedRanges!
      var ranges = sourceRanges.slice(0);
      if (sourceRanges.copy) {
        ranges.copy = sourceRanges.copy;
      }
      // override ranges' copy attribute?
      if (cutMode != null) {
        ranges.copy = !cutMode;
      }

      if (ranges.length !== 0) {
        _copiedRanges = ranges;
        markCopySelection(ranges);
        _self.onCopyCells.notify({
          ranges: ranges, 
          rangeIsCopied: ranges.copy 
        });

        var columns = _grid.getColumns();
        var clipTextArr = [];
        var range, i, j;

        // Note: this feature only works well when you have either a single range or all ranges address the same columns
        if (_options.includeHeaderWhenCopying) {
            var clipTextHeaders = [];
            range = ranges[0];

            for (j = range.fromCell; j < range.toCell + 1; j++) {
                clipTextHeaders.push(columns[j].name || "");
            }
            clipTextArr.push(clipTextHeaders.join("\t") + "\r\n");
        }

        for (var rg = 0; rg < ranges.length; rg++) {
            range = ranges[rg];
            var clipTextRows = [];
            for (i = range.fromRow; i < range.toRow + 1; i++) {
                var clipTextCells = [];
                var dt = _grid.getDataItem(i);

                for (j = range.fromCell; j < range.toCell + 1; j++) {
                    clipTextCells.push(getDataItemValueForColumn(dt, columns[j], clipTextRows.length, clipTextCells.length, i, j));
                }
                clipTextRows.push(clipTextCells.join("\t"));
            }
            clipTextArr.push(clipTextRows.join("\r\n"));
        }
        var clipText = clipTextArr.join("");
        _copyFingerPrint = clipText.replace(/\r/g, "");

        if (toClipboard) {
          return sendToNativeClipboard(clipText);
        } else {
          return clipText;
        }
      }
      return false;
    }
/**
     * perform a 'copy' or 'cut' operation.
     *
     * @param  {Array}   ranges       set of ranges to copy/cut from. Each entry is a Slick.Range instance
     * @param  {Boolean} cutMode      A truthy value when you wish to 'cut', a falsey value signals this to be a 'copy' operation (which is the default).
     * @param  {Boolean} toClipboard  When TRUE, copy the TSV-formatted textual representation of the selected range(s) to the operating system's clipboard.
     *                                When FALSE, the function will instead return the textual representation (TSV format) of the selected data.
     * 
     * Note that you can alternatively pass the `copyMode` as an attributes of the `ranges` array, in which case `cutMode` must be `undefined` or `null`.
     *
     * @returns {Boolean}  TRUE when the data has been copied to the Clipboard too using the new HTML5 API; false otherwise.
     *                     (This return value is used to act correctly when performing a copy/paste action from the keyboard.)
     */
perform a 'copy' or 'cut' operation.
@param  {Array}   ranges       set of ranges to copy/cut from. Each entry is a Slick.Range instance
@param  {Boolean} cutMode      A truthy value when you wish to 'cut', a falsey value signals this to be a 'copy' operation (which is the default).
@param  {Boolean} toClipboard  When TRUE, copy the TSV-formatted textual representation of the selected range(s) to the operating system's clipboard.
When FALSE, the function will instead return the textual representation (TSV format) of the selected data.



@returns {Boolean}  TRUE when the data has been copied to the Clipboard too using the new HTML5 API; false otherwise.
(This return value is used to act correctly when performing a copy/paste action from the keyboard.)
perform a ' copy ' or ' cut ' operation . @param { Array } ranges set of ranges to copy / cut from . Each entry is a Slick . Range instance @param { Boolean } cutMode A truthy value when you wish to ' cut ' a falsey value signals this to be a ' copy ' operation ( which is the default ) . @param { Boolean } toClipboard When TRUE copy the TSV - formatted textual representation of the selected range ( s ) to the operating system ' s clipboard . When FALSE the function will instead return the textual representation ( TSV format ) of the selected data . @returns { Boolean } TRUE when the data has been copied to the Clipboard too using the new HTML5 API ; false otherwise . ( This return value is used to act correctly when performing a copy / paste action from the keyboard . )
function cutOrCopyAction(sourceRanges, cutMode, toClipboard) {
      assert(Array.isArray(sourceRanges));
      var ranges = sourceRanges.slice(0);
      if (sourceRanges.copy) {
        ranges.copy = sourceRanges.copy;
      }
      if (cutMode != null) {
        ranges.copy = !cutMode;
      }
      if (ranges.length !== 0) {
        _copiedRanges = ranges;
        markCopySelection(ranges);
        _self.onCopyCells.notify({
          ranges: ranges, 
          rangeIsCopied: ranges.copy 
        });
        var columns = _grid.getColumns();
        var clipTextArr = [];
        var range, i, j;
        if (_options.includeHeaderWhenCopying) {
            var clipTextHeaders = [];
            range = ranges[0];
            for (j = range.fromCell; j < range.toCell + 1; j++) {
                clipTextHeaders.push(columns[j].name || "");
            }
            clipTextArr.push(clipTextHeaders.join("\t") + "\r\n");
        }
        for (var rg = 0; rg < ranges.length; rg++) {
            range = ranges[rg];
            var clipTextRows = [];
            for (i = range.fromRow; i < range.toRow + 1; i++) {
                var clipTextCells = [];
                var dt = _grid.getDataItem(i);
                for (j = range.fromCell; j < range.toCell + 1; j++) {
                    clipTextCells.push(getDataItemValueForColumn(dt, columns[j], clipTextRows.length, clipTextCells.length, i, j));
                }
                clipTextRows.push(clipTextCells.join("\t"));
            }
            clipTextArr.push(clipTextRows.join("\r\n"));
        }
        var clipText = clipTextArr.join("");
        _copyFingerPrint = clipText.replace(/\r/g, "");
        if (toClipboard) {
          return sendToNativeClipboard(clipText);
        } else {
          return clipText;
        }
      }
      return false;
    }
function cutOrCopyAction ( sourceRanges , cutMode , toClipboard ) { assert ( Array . isArray ( sourceRanges ) ) ; var ranges = sourceRanges . slice ( 0 ) ; if ( sourceRanges . copy ) { ranges . copy = sourceRanges . copy ; } if ( cutMode != null ) { ranges . copy = ! cutMode ; } if ( ranges . length !== 0 ) { _copiedRanges = ranges ; markCopySelection ( ranges ) ; _self . onCopyCells . notify ( { ranges : ranges , rangeIsCopied : ranges . copy } ) ; var columns = _grid . getColumns ( ) ; var clipTextArr = [ ] ; var range , i , j ; if ( _options . includeHeaderWhenCopying ) { var clipTextHeaders = [ ] ; range = ranges [ 0 ] ; for ( j = range . fromCell ; j < range . toCell + 1 ; j ++ ) { clipTextHeaders . push ( columns [ j ] . name || "" ) ; } clipTextArr . push ( clipTextHeaders . join ( "\t" ) + "\r\n" ) ; } for ( var rg = 0 ; rg < ranges . length ; rg ++ ) { range = ranges [ rg ] ; var clipTextRows = [ ] ; for ( i = range . fromRow ; i < range . toRow + 1 ; i ++ ) { var clipTextCells = [ ] ; var dt = _grid . getDataItem ( i ) ; for ( j = range . fromCell ; j < range . toCell + 1 ; j ++ ) { clipTextCells . push ( getDataItemValueForColumn ( dt , columns [ j ] , clipTextRows . length , clipTextCells . length , i , j ) ) ; } clipTextRows . push ( clipTextCells . join ( "\t" ) ) ; } clipTextArr . push ( clipTextRows . join ( "\r\n" ) ) ; } var clipText = clipTextArr . join ( "" ) ; _copyFingerPrint = clipText . replace ( / \r / g , "" ) ; if ( toClipboard ) { return sendToNativeClipboard ( clipText ) ; } else { return clipText ; } } return false ; }
perform a 'copy' or 'cut' operation.
perform a ' copy ' or ' cut ' operation .
// make sure to clone (shallow) the range set as any subsequent selection action will echo into _copiedRanges! // override ranges' copy attribute? // Note: this feature only works well when you have either a single range or all ranges address the same columns