/ember-cli-llama-table

Easy Ember.js table component

Primary LanguageJavaScriptMIT LicenseMIT

ember-cli-llama-table

Easy Ember.js table component.

master branch build status

ember-cli-llama-table is an Ember component for easily rendering tables with advanced features and functionality.

Example

controllers/index.js:

import Ember from 'ember';
export default Ember.Controller.extend({
    tableColumns: [
        {
            name: 'foo',
            label: 'Foo',
            order: 1
        },
        {
            name: 'bar',
            label: 'Bar',
            order: 2
        }
    ],
    tableData: [
        {
            foo: 'abc',
            bar: 'def'
        },
        {
            foo: 'ghi',
            bar: 'jkl'
        }
    ],
    tableConfig: {
        sortProperties: ['foo', 'bar']
    }
});

templates/index.hbs:

{{llama-table rows=tableData columns=tableColumns config=tableConfig}}

For an example implementation, see the project page.

Properties

columns

Column configuration. Defines the appearance and behaviour of table columns. Will be monitored for changes, causing the component to update accordingly.

Wiki page on column definitions.

rows

Table data as an array of objects. Each object has properties which map with column identifiers. Row additions, removals or edits will be reflected by the table.

config

Table configuration. Specifies additional properties as a single object.

Wiki page on table configuration.

Installing

With npm:

$ npm install --save ember-cli-llama-table

Or with Ember CLI:

$ ember install:npm ember-cli-llama-table

License

MIT license.