public/js/handsontable/jquery.handsontable.full.js
function (start, input, end, source) {
      var r, rlen, c, clen, td, setData = [], current = {};
      rlen = input.length;
      if (rlen === 0) {
        return false;
      }
      current.row = start.row;
      current.col = start.col;
      for (r = 0; r < rlen; r++) {
        if ((end && current.row > end.row) || (!priv.settings.minSpareRows && current.row > self.countRows() - 1) || (current.row >= priv.settings.maxRows)) {
          break;
        }
        current.col = start.col;
        clen = input[r] ? input[r].length : 0;
        for (c = 0; c < clen; c++) {
          if ((end && current.col > end.col) || (!priv.settings.minSpareCols && current.col > self.colCount - 1) || (current.col >= priv.settings.maxCols)) {
            break;
          }
          td = self.view.getCellAtCoords(current);
          if (self.getCellMeta(current.row, current.col).isWritable) {
            var p = datamap.colToProp(current.col);
            setData.push([current.row, p, input[r][c]]);
          }
          current.col++;
          if (end && c === clen - 1) {
            c = -1;
          }
        }
        current.row++;
        if (end && r === rlen - 1) {
          r = -1;
        }
      }
      self.setDataAtCell(setData, null, null, source || 'populateFromArray');
    }
function (start, input, end, source) {
      var r, rlen, c, clen, td, setData = [], current = {};
      rlen = input.length;
      if (rlen === 0) {
        return false;
      }
      current.row = start.row;
      current.col = start.col;
      for (r = 0; r < rlen; r++) {
        if ((end && current.row > end.row) || (!priv.settings.minSpareRows && current.row > self.countRows() - 1) || (current.row >= priv.settings.maxRows)) {
          break;
        }
        current.col = start.col;
        clen = input[r] ? input[r].length : 0;
        for (c = 0; c < clen; c++) {
          if ((end && current.col > end.col) || (!priv.settings.minSpareCols && current.col > self.colCount - 1) || (current.col >= priv.settings.maxCols)) {
            break;
          }
          td = self.view.getCellAtCoords(current);
          if (self.getCellMeta(current.row, current.col).isWritable) {
            var p = datamap.colToProp(current.col);
            setData.push([current.row, p, input[r][c]]);
          }
          current.col++;
          if (end && c === clen - 1) {
            c = -1;
          }
        }
        current.row++;
        if (end && r === rlen - 1) {
          r = -1;
        }
      }
      self.setDataAtCell(setData, null, null, source || 'populateFromArray');
    }
function ( start , input , end , source ) { var r , rlen , c , clen , td , setData = [ ] , current = { } ; rlen = input . length ; if ( rlen === 0 ) { return false ; } current . row = start . row ; current . col = start . col ; for ( r = 0 ; r < rlen ; r ++ ) { if ( ( end && current . row > end . row ) || ( ! priv . settings . minSpareRows && current . row > self . countRows ( ) - 1 ) || ( current . row >= priv . settings . maxRows ) ) { break ; } current . col = start . col ; clen = input [ r ] ? input [ r ] . length : 0 ; for ( c = 0 ; c < clen ; c ++ ) { if ( ( end && current . col > end . col ) || ( ! priv . settings . minSpareCols && current . col > self . colCount - 1 ) || ( current . col >= priv . settings . maxCols ) ) { break ; } td = self . view . getCellAtCoords ( current ) ; if ( self . getCellMeta ( current . row , current . col ) . isWritable ) { var p = datamap . colToProp ( current . col ) ; setData . push ( [ current . row , p , input [ r ] [ c ] ] ) ; } current . col ++ ; if ( end && c === clen - 1 ) { c = - 1 ; } } current . row ++ ; if ( end && r === rlen - 1 ) { r = - 1 ; } } self . setDataAtCell ( setData , null , null , source || 'populateFromArray' ) ; }
Populate cells at position with 2d array
@param {Object} start Start selection position
@param {Array} input 2d array
@param {Object} [end] End selection position (only for drag-down mode)
@param {String} [source="populateFromArray"]
@return {Object|undefined} ending td in pasted area (only if any cell was changed)
Populate cells at position with 2d array