matiassantos / ng2-handsontable

Angular 2 directive for Handsontable

Home Page:http://valor-software.github.io/ng2-handsontable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ng2-handsontable

Native Angular2 directive for the Handsontable component.

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:

import {HotTableModule} from 'ng2-handsontable';
...

@NgModule({
  ...
  imports: [
    HotTableModule
  ],
  ...
})
export class MyModule {
}
  1. Use the hot-table directive in your template. The following example displays the supported attributes:
<hot-table [data]="data"
           [columns]="columns"
           [col-headers]="colHeaders"
           [col-widths]="colHeaders"
           [options]="options"
           (HANDSONTABLE_EVENT)="eventHandler">
</hot-table>
  • data: any[] - data source for this HotTable
  • pageData: Observable<any[]> - observable data source for this HotTable for paged data
  • columns?: any[] - descriptors of columns that contains information regarding type, format, source, ... of particular column
  • col-headers?: string[] - array of column headers, default column headers will be shown (or not be shown, it depends on other settings) if this parameter is undefined
  • col-widths?: number[] - array of column sizes, default column size will be applied if this parameter is undefined
  • options?: any - any of the Handsontable options
  • 'HANDSONTABLE_EVENT' - all Handsontable events are implemented as EventEmitters, e.g. (beforeInit)="onBeforeInit".

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

  1. 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)

About

Angular 2 directive for Handsontable

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

License:MIT License


Languages

Language:JavaScript 63.8%Language:TypeScript 36.2%