spreadsheet/ruleJS.all.full.js
function (startCell, endCell, callback) {
      var result = {
        index: [], // list of cell index: A1, A2, A3
        value: []  // list of cell value
      };

      var cols = {
        start: 0,
        end: 0
      };

      if (endCell.col >= startCell.col) {
        cols = {
          start: startCell.col,
          end: endCell.col
        };
      } else {
        cols = {
          start: endCell.col,
          end: startCell.col
        };
      }

      var rows = {
        start: 0,
        end: 0
      };

      if (endCell.row >= startCell.row) {
        rows = {
          start: startCell.row,
          end: endCell.row
        };
      } else {
        rows = {
          start: endCell.row,
          end: startCell.row
        };
      }

      for (var column = cols.start; column <= cols.end; column++) {
        for (var row = rows.start; row <= rows.end; row++) {
          var cellIndex = instance.utils.toChar(column) + (row + 1),
              cellValue = instance.helper.cellValue.call(this, cellIndex);

          result.index.push(cellIndex);
          result.value.push(cellValue);
        }
      }

      if (instance.utils.isFunction(callback)) {
        return callback.apply(callback, [result]);
      } else {
        return result;
      }
    }
function (startCell, endCell, callback) {
      var result = {
        index: [], // list of cell index: A1, A2, A3
        value: []  // list of cell value
      };

      var cols = {
        start: 0,
        end: 0
      };

      if (endCell.col >= startCell.col) {
        cols = {
          start: startCell.col,
          end: endCell.col
        };
      } else {
        cols = {
          start: endCell.col,
          end: startCell.col
        };
      }

      var rows = {
        start: 0,
        end: 0
      };

      if (endCell.row >= startCell.row) {
        rows = {
          start: startCell.row,
          end: endCell.row
        };
      } else {
        rows = {
          start: endCell.row,
          end: startCell.row
        };
      }

      for (var column = cols.start; column <= cols.end; column++) {
        for (var row = rows.start; row <= rows.end; row++) {
          var cellIndex = instance.utils.toChar(column) + (row + 1),
              cellValue = instance.helper.cellValue.call(this, cellIndex);

          result.index.push(cellIndex);
          result.value.push(cellValue);
        }
      }

      if (instance.utils.isFunction(callback)) {
        return callback.apply(callback, [result]);
      } else {
        return result;
      }
    }
function ( startCell , endCell , callback ) { var result = { index : [ ] , // list of cell index: A1, A2, A3 value : [ ] // list of cell value } ; var cols = { start : 0 , end : 0 } ; if ( endCell . col >= startCell . col ) { cols = { start : startCell . col , end : endCell . col } ; } else { cols = { start : endCell . col , end : startCell . col } ; } var rows = { start : 0 , end : 0 } ; if ( endCell . row >= startCell . row ) { rows = { start : startCell . row , end : endCell . row } ; } else { rows = { start : endCell . row , end : startCell . row } ; } for ( var column = cols . start ; column <= cols . end ; column ++ ) { for ( var row = rows . start ; row <= rows . end ; row ++ ) { var cellIndex = instance . utils . toChar ( column ) + ( row + 1 ) , cellValue = instance . helper . cellValue . call ( this , cellIndex ) ; result . index . push ( cellIndex ) ; result . value . push ( cellValue ) ; } } if ( instance . utils . isFunction ( callback ) ) { return callback . apply ( callback , [ result ] ) ; } else { return result ; } }
iterate cell range and get theirs indexes and values
@param {Object} startCell ex.: {row:1, col: 1}
@param {Object} endCell ex.: {row:10, col: 1}
@param {Function=} callback
@returns {{index: Array, value: Array}}
iterate cell range and get theirs indexes and values