valor-software/ng2-handsontable

Name: ng2-handsontable

Owner: Valor Software

Description: Angular 2 directive for Handsontable

Created: 2015-09-16 07:32:06.0

Updated: 2018-05-02 14:14:55.0

Pushed: 2018-04-09 15:57:19.0

Homepage: http://valor-software.github.io/ng2-handsontable/

Size: 7582

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ng2-handsontable

Native Angular2+ wrapper for Handsontable.

Handsontable is a data grid component with an Excel-like appearance. Built in JavaScript, it integrates with any data source and comes with features like data validation, sorting, grouping, data binding or column ordering. Actively supported by the Handsoncode team and the GitHub community.


Quick start
  1. Add ng2-handsontable to your package.json or install with npm i ng2-handsontable --save.

  2. If you are using SystemJS, add the ng2-handsontable path to your SystemJS.config.js: 'ng2-handsontable': 'node_modules/ng2-handsontable/bundles/ng2-handsontable.umd.js'. Webpack (used by Angular-CLI) picks up the path automatically.

  3. Import the HotTableModule into your module. Here's a TypeScript example:

rt { HotTableModule } from 'ng2-handsontable';


odule({
.
ports: [
HotTableModule

.

rt class MyModule {

  1. Use the hot-table component in your template. The following example displays the supported attributes:
-table [data]="data"
       [columns]="columns"
       [colHeaders]="colHeaders"
       [colWidths]="colHeaders"
       [options]="options"
       (HANDSONTABLE_EVENT)="eventHandler">
t-table>

The free version of Handsontable is used by default, but the pro-version could be used as a drop-in replacement.

  1. The following methods are available as a public API on HotTableComponent (which you can access from your parent component with @ViewChild(HotTableComponent) hotTableComponent):

  2. getHandsontableInstance(): Handsontable - returns the underlying Handsontable Core instance; all registered Handsontable plugins are accessible via instance.getPlugin()

  3. triggerOnChanges(properties: ('data' | 'options' | 'colHeaders' | 'colWidths' | 'columns')[])- Call this function to trigger the OnChanges logic for any of the given input properties, in case they were changed partially, rather than replaced by a new object. Angular would pick up the latter in ngOnChanges(), but not the former. For example, if another row has been added to the 'data' input array, call triggerOnChanges(['data']).

  4. See the demo and the demo sources for further details.

Troubleshooting

Please follow this guidelines when reporting bugs and feature requests:

  1. Use GitHub Issues board to report bugs and feature requests (not our email address)
  2. Please always write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.

Thanks for your understanding!

License

The MIT License (see the LICENSE file for the full text)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.