New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

handsontable

Package Overview
Dependencies
Maintainers
5
Versions
887
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handsontable

Handsontable is a JavaScript Spreadsheet Component available for React, Angular and Vue.

  • 0.0.0-next-b04257e-20241210
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
66K
decreased by-25.28%
Maintainers
5
Weekly downloads
 
Created

What is handsontable?

Handsontable is a JavaScript/HTML5 data grid component with a spreadsheet look & feel. It is designed to handle large volumes of data and provides a wide range of features for data manipulation and visualization.

What are handsontable's main functionalities?

Data Grid

Handsontable provides a powerful data grid component that can be easily integrated into web applications. The code sample demonstrates how to create a basic data grid with row and column headers.

const container = document.getElementById('example');
const hot = new Handsontable(container, {
  data: Handsontable.helper.createSpreadsheetData(6, 10),
  rowHeaders: true,
  colHeaders: true
});

Data Validation

Handsontable supports data validation to ensure that the data entered into the grid meets certain criteria. The code sample shows how to set up a numeric validator for an 'age' column.

const hot = new Handsontable(container, {
  data: Handsontable.helper.createSpreadsheetData(6, 10),
  columns: [
    {data: 'id', type: 'numeric'},
    {data: 'name', type: 'text'},
    {data: 'age', type: 'numeric', validator: (value) => value > 0}
  ],
  rowHeaders: true,
  colHeaders: true
});

Custom Cell Rendering

Handsontable allows for custom cell rendering, enabling developers to change the appearance of cells based on their data. The code sample demonstrates how to change the background color of cells in the 'age' column if the value is greater than 50.

const hot = new Handsontable(container, {
  data: Handsontable.helper.createSpreadsheetData(6, 10),
  columns: [
    {data: 'id', type: 'numeric'},
    {data: 'name', type: 'text'},
    {data: 'age', type: 'numeric'}
  ],
  cells: function (row, col) {
    const cellProperties = {};
    if (col === 2) {
      cellProperties.renderer = function (instance, td, row, col, prop, value, cellProperties) {
        Handsontable.renderers.TextRenderer.apply(this, arguments);
        if (value > 50) {
          td.style.backgroundColor = 'red';
        }
      };
    }
    return cellProperties;
  },
  rowHeaders: true,
  colHeaders: true
});

Other packages similar to handsontable

Keywords

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc