UNPKG

handsontable

Version:

Handsontable is a JavaScript Data Grid available for React, Angular and Vue.

25 lines (24 loc) 877 B
"use strict"; exports.__esModule = true; exports.getCellMetas = getCellMetas; var _number = require("../../helpers/number"); /** * Gets all cell metas from the provided range. * * @param {Core} hot The Handsontable instance. * @param {number} fromRow The starting row index. * @param {number} toRow The ending row index. * @param {number} fromColumn The starting column index. * @param {number} toColumn The ending column index. * @returns {Array} Returns an array of cell metas. */ function getCellMetas(hot, fromRow, toRow, fromColumn, toColumn) { const cellMetas = []; (0, _number.rangeEach)(fromColumn, toColumn, columnIndex => { (0, _number.rangeEach)(fromRow, toRow, rowIndex => { const cellMeta = hot.getCellMeta(rowIndex, columnIndex); cellMetas.push([cellMeta.visualRow, cellMeta.visualCol, cellMeta]); }); }); return cellMetas; }