• Stars
    star
    433
  • Rank 96,723 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Official AngularJS directive for Handsontable

ngHandsontable - the AngularJS directive for Handsontable Build Status

Enables creation of data grid applications in AngularJS.

Demo

See the demo at http://handsontable.github.io/ngHandsontable.

Usage

Include the library files:

<link rel="stylesheet" media="screen" href="bower_components/handsontable/dist/handsontable.full.css">
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/handsontable/dist/handsontable.full.js"></script>
<script src="dist/ngHandsontable.js"></script>

Include component to your app:

angular.module('my-app', ['ngHandsontable']);

Template:

<hot-table settings="{colHeaders: colHeaders, contextMenu: ['row_above', 'row_below', 'remove_row'], afterChange: afterChange}"
           row-headers="false"
           min-spare-rows="minSpareRows"
           datarows="db.items"
           height="300"
           width="700">
    <hot-column data="id" title="'ID'"></hot-column>
    <hot-column data="name.first" title="'First Name'" type="grayedOut" read-only></hot-column>
    <hot-column data="name.last" title="'Last Name'" type="grayedOut" read-only></hot-column>
    <hot-column data="address" title="'Address'" width="150"></hot-column>
    <hot-column data="product.description" title="'Favorite food'" type="'autocomplete'">
        <hot-autocomplete datarows="description in product.options"></hot-autocomplete>
    </hot-column>
    <hot-column data="price" title="'Price'" type="'numeric'" width="80" format="'$ 0,0.00'"></hot-column>
    <hot-column data="isActive" title="'Is active'" type="'checkbox'" width="65" checked-template="'Yes'" unchecked-template="'No'"></hot-column>
</hot-table>

Controller:

$scope.db.items = [
  {
    "id": 1,
    "name": {
      "first": "John",
      "last": "Schmidt"
    },
    "address": "45024 France",
    "price": 760.41,
    "isActive": "Yes",
    "product": {
      "description": "Fried Potatoes",
      "options": [
        {
          "description": "Fried Potatoes",
          "image": "//a248.e.akamai.net/assets.github.com/images/icons/emoji/fries.png"
        },
        {
          "description": "Fried Onions",
          "image": "//a248.e.akamai.net/assets.github.com/images/icons/emoji/fries.png"
        }
      ]
    }
  },
  //more items go here
];

Directives and attributes specification

Main directive for creating table is <hot-table>. For defining column options you can use settings object with columns property. If you want to describe column behavior in declarative way you can add <hot-column> directive as a children of <hot-table> element and add all neccessary attributes to describe column options.

All Handsontable options listed here should be supported. Options in camelCase mode should be passed to the directive in hyphenate mode e.q autoWrapCol: true -> <hot-table auto-wrap-col>.

It's recommended to put all your settings in one big object (settings="ctrl.settings"). Settings attribute unlike any other attributes is not watched so using this can be helpful to achieve higher performance.

License

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

More Repositories

1

handsontable

JavaScript data grid with a spreadsheet look & feel. Works with React, Angular, and Vue. Supported by the Handsontable team âš¡
JavaScript
18,903
star
2

hyperformula

HyperFormula is an open-source headless spreadsheet for business web apps. It comes with over 400 formulas, CRUD operations, undo-redo, clipboard support, and sorting. Built in TypeScript, supported by the Handsontable Team.
TypeScript
1,716
star
3

vue-handsontable-official

Vue Data Grid with Spreadsheet Look & Feel. Official Vue wrapper for Handsontable.
TypeScript
748
star
4

formula-parser

Javascript Library parsing Excel Formulas and more
JavaScript
630
star
5

react-handsontable

React Data Grid with Spreadsheet Look & Feel. Official React wrapper for Handsontable.
TypeScript
515
star
6

angular-handsontable

Angular Data Grid with Spreadsheet Look & Feel. Official Angular wrapper for Handsontable.
TypeScript
173
star
7

ruleJS

Javascript library to parse excel formulas
JavaScript
154
star
8

hot-table

Handsontable - Best Data Grid Web Component with Spreadsheet Look and Feel.
JavaScript
129
star
9

handsontable-pro

Handsontable Pro - Premium JavaScript/HTML5 Data Grid Component with Spreadsheet Look & Feel. Available for React, Vue and Angular.
JavaScript
88
star
10

handsontable-ruleJS

Formula parser for Handsontable data grid using RuleJS library
JavaScript
59
star
11

spreadsheet-viewer

Spreadsheet Viewer is a developer-friendly JavaScript tool that lets your users preview Excel files without leaving your web app
27
star
12

handsontable-skeleton

Handsontable Skeleton
JavaScript
20
star
13

docs

API Documentation for Handsontable
HTML
20
star
14

hot-builder

CLI tool for building custom Handsontable package
JavaScript
16
star
15

performance-lab

JavaScript performance tests for Handsontable
JavaScript
12
star
16

hyperformula-demos

JavaScript
10
star
17

spreadsheet-icons

Spreadsheet icons - a minimalistic icon set for data views (data grids, spreadsheets and tables)
10
star
18

jstat

JavaScript Statistical Library
JavaScript
8
star
19

docs-archive

API Documentation for Handsontable
6
star
20

examples

Examples for Handsontable component
TypeScript
1
star
21

docs-pro-archive

API Documentation for Handsontable Pro
1
star
22

babel-plugin-forbidden-imports

Babel plugin which adds you ability to forbidden load specific modules
JavaScript
1
star