How to use the handsontable/helpers/array.arrayEach function in handsontable

To help you get started, we’ve selected a few handsontable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Graphite-Docs / graphite / node_modules / handsontable-pro / src / plugins / filters / component / condition.js View on Github external
reset() {
    const lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
    const visualIndex = lastSelectedColumn && lastSelectedColumn.visualIndex;
    const columnType = this.hot.getDataType.apply(this.hot, this.hot.getSelectedLast() || [0, visualIndex]);
    const items = getOptionsList(columnType);

    arrayEach(this.getInputElements(), (element) => element.hide());
    this.getSelectElement().setItems(items);
    super.reset();
    // Select element as default 'None'
    this.getSelectElement().setValue(items[0]);
  }
github Graphite-Docs / graphite / node_modules / handsontable-pro / src / plugins / nestedHeaders / nestedHeaders.js View on Github external
checkForOverlappingHeaders() {
    arrayEach(this.colspanArray, (level, i) => {
      arrayEach(this.colspanArray[i], (header, j) => {
        if (header.colspan > 1) {
          let row = this.levelToRowCoords(i);
          let childHeaders = this.getChildHeaders(row, j);

          if (childHeaders.length > 0) {
            let childColspanSum = 0;

            arrayEach(childHeaders, (col, i) => {
              childColspanSum += this.getColspan(row + 1, col);
            });

            if (childColspanSum > header.colspan) {
              console.warn('Your Nested Headers plugin setup contains overlapping headers. This kind of configuration is ' +
                'currently not supported and might result in glitches.');
            }
github Graphite-Docs / graphite / node_modules / handsontable-pro / es / plugins / nestedHeaders / nestedHeaders.js View on Github external
value: function checkForOverlappingHeaders() {
      var _this5 = this;

      arrayEach(this.colspanArray, function (level, i) {
        arrayEach(_this5.colspanArray[i], function (header, j) {
          if (header.colspan > 1) {
            var row = _this5.levelToRowCoords(i);
            var childHeaders = _this5.getChildHeaders(row, j);

            if (childHeaders.length > 0) {
              var childColspanSum = 0;

              arrayEach(childHeaders, function (col, i) {
                childColspanSum += _this5.getColspan(row + 1, col);
              });

              if (childColspanSum > header.colspan) {
                console.warn('Your Nested Headers plugin setup contains overlapping headers. This kind of configuration is ' + 'currently not supported and might result in glitches.');
              }
github Graphite-Docs / graphite / node_modules / handsontable-pro / src / plugins / trimRows / trimRows.js View on Github external
untrimRows(rows) {
    arrayEach(rows, (row) => {
      row = parseInt(row, 10);

      if (this.isTrimmed(row)) {
        this.trimmedRows.splice(this.trimmedRows.indexOf(row), 1);
      }
    });

    this.hot.runHooks('skipLengthCache', 100);
    this.rowsMapper.createMap(this.hot.countSourceRows());
    this.hot.runHooks('afterUntrimRow', rows);
  }
github Graphite-Docs / graphite / node_modules / handsontable-pro / es / plugins / trimRows / trimRows.js View on Github external
value: function trimRows(rows) {
      var _this3 = this;

      arrayEach(rows, function (row) {
        row = parseInt(row, 10);

        if (!_this3.isTrimmed(row)) {
          _this3.trimmedRows.push(row);
        }
      });

      this.hot.runHooks('skipLengthCache', 100);
      this.rowsMapper.createMap(this.hot.countSourceRows());
      this.hot.runHooks('afterTrimRow', rows);
    }
github Graphite-Docs / graphite / node_modules / handsontable-pro / src / plugins / filters / ui / multipleSelect.js View on Github external
function itemsToValue(availableItems) {
  let items = [];

  arrayEach(availableItems, (item) => {
    if (item.checked) {
      items.push(item.value);
    }
  });

  return items;
}
github Graphite-Docs / graphite / node_modules / handsontable-pro / es / plugins / filters / filters.js View on Github external
value: function getDataMapAtColumn(column) {
      var _this4 = this;

      var visualIndex = this.t.toVisualColumn(column);
      var data = [];

      arrayEach(this.hot.getSourceDataAtCol(visualIndex), function (value, rowIndex) {
        var _hot$getCellMeta = _this4.hot.getCellMeta(rowIndex, visualIndex),
            row = _hot$getCellMeta.row,
            col = _hot$getCellMeta.col,
            visualCol = _hot$getCellMeta.visualCol,
            visualRow = _hot$getCellMeta.visualRow,
            type = _hot$getCellMeta.type,
            instance = _hot$getCellMeta.instance,
            dateFormat = _hot$getCellMeta.dateFormat;

        data.push({
          meta: { row: row, col: col, visualCol: visualCol, visualRow: visualRow, type: type, instance: instance, dateFormat: dateFormat },
          value: toEmptyString(value)
        });
      });

      return data;
github Graphite-Docs / graphite / node_modules / handsontable-pro / src / plugins / filters / filters.js View on Github external
arrayEach(components, (component) => {
      arrayEach(menu.menuItems, (item, index) => {
        if (item.key === component.getMenuItemDescriptor().key) {

          indexes.push(index);
        }
      });
    });
github Graphite-Docs / graphite / node_modules / handsontable-pro / src / plugins / filters / component / condition.js View on Github external
registerHooks() {
    this.getSelectElement().addLocalHook('select', (command) => this.onConditionSelect(command));
    this.getSelectElement().addLocalHook('afterClose', () => this.onSelectUIClosed());

    arrayEach(this.getInputElements(), (input) => {
      input.addLocalHook('keydown', (event) => this.onInputKeyDown(event));
    });
  }
github Graphite-Docs / graphite / node_modules / handsontable-pro / es / plugins / filters / ui / multipleSelect.js View on Github external
value: function onSelectAllClick(event) {
      event.preventDefault();
      arrayEach(this.itemsBox.getSourceData(), function (row) {
        row.checked = true;
      });
      this.itemsBox.render();
    }