How to use the handsontable.dom 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 kpi-intelligence / handsontable-key-value / src / editors / keyValueEditor.js View on Github external
import Handsontable from 'handsontable';

import { getDisplayValue } from '../common';

const { getCaretPosition, getSelectionEndPosition, setCaretPosition } = Handsontable.dom;

class KeyValueEditor extends Handsontable.editors.AutocompleteEditor {

  prepare(row, col, prop, td, originalValue, cellProperties, ...args) {
    super.prepare(row, col, prop, td, originalValue, cellProperties, ...args);
    this.cellProperties.strict = true; // Force strict mode (key-value context)
  }

  getValue() {
    const selection = this.htEditor.getSelectedLast();
    if (selection) {
      return this.htEditor.getSourceDataAtRow(selection[0])[this.cellProperties.keyProperty];
    }
  }

  setValue(value) {
github hand-dot / taskontable / src / hot.js View on Github external
renderer(instance, td, row, col, prop, value) {
        if (instance.isEmptyRow(row)) {
          td.innerHTML = null;
          return td;
        }
        const { members } = instance.getSettings();
        if (!members) {
          td.innerHTML = null;
          return td;
        }
        const assingedUser = members[members.findIndex(member => member.uid === value)];
        td.className = 'htCenter htMiddle';
        td.style.paddingTop = '5px';
        Handsontable.dom.empty(td);
        const img = document.createElement('IMG');
        img.style.width = '25px';
        img.style.height = '25px';
        img.style.borderRadius = '50%';
        if (assingedUser) {
          img.src = assingedUser.photoURL || person;
        } else {
          img.src = value ? unknown : logoMini; // unknownは削除されたユーザー
          img.title = value ? '@unknown' : '@every';
        }
        if (td.parentNode.style.backgroundColor === constants.cellColor.RUNNING) {
          img.style.animation = `busy 3s ${row % 3}s infinite`;
        } else if (td.parentNode.style.backgroundColor === constants.cellColor.OUT) {
          img.style.animation = 'help 1s infinite';
        }
        td.appendChild(img);
github tabixio / tabix / src / components / Handsontable / plugins / dropmenu.js View on Github external
onToggleMenuClick(event) {

        if (typeof event.stopPropagation === 'function') {
            event.stopPropagation();
        } else {
            event.cancelBubble = true;
        }

        if (Handsontable.dom.hasClass(event.target, MENU_BUTTON_CLASS_NAME) ) {
            let rect = event.target.getBoundingClientRect();
            this.menu(this,event,rect);

        }
    }
github materialsproject / MPContribs / mpcontribs-portal / mpcontribs / portal / assets / js / landingpage.js View on Github external
function make_url_cell(td, text, href) {
    Handsontable.dom.empty(td);
    var url = make_url(text, href);
    $(td).addClass('htCenter').addClass('htMiddle').append(url);
}