npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ember-datatables

v0.1.0

Published

Ember addon that implements the data-table component for rendering tabular data using the DataTables library.

Readme

ember-datatables

Build Status

Current Status

The ember-datatables addon works, but it under very active development and is still early in the project. The current version is published for use in my projects, and for the use of other early adopters in order to gain feedback. If it works for you in its current state and you are happy with how it is working, you are welcome to use it in your production applications or in-development applications. I will happily provide support, bug fixes, and new features for you if you ask. This addon is not feature complete, but I will be adding new features freqently until I have most capabilities of the DataTables control implemented. Please use the Issues page to report bugs or feature requests.

This project will be "stable" at version 1.0.0.

Overview

ember-datatables is an Ember addon that introduces the data-table component for Ember applications. data-table uses the DataTables library to add advanced rendering functionality for HTML tables.

Installing the ember-datatables Addon

To use the ember-datatables addon in your Ember application, you first need to install it. This can be done using Ember CLI:

ember install ember-datatables

Ember CLI will install the ember-datatables addon and will add the dependency reference to it to your application's package.json file.

Installing the ember-datatables addon will also install the following Bower components into your application:

In addition, ember-datatables depends on the ember-moment addon which will also add the Moment.js library to your Ember application.

Using the ember-datatables Addon

The ember-datatables addon introduces the data-table component into your Ember application. data-table will render an HTML table element containing the data that you pass into the table. Table data can be specified in two ways:

  • embedded HTML table elements (tr, th, td) inside of thead, tbody, and tfoot elements;
  • Ember Data models that are loaded from the store

HTML Table Example

To render data inside of a table, you can place the HTML table markup inside of the data-table component:

{{#data-table}}
  <thead>
    <tr>
      <th>Name</th>
      <th>Position</th>
      <th>Office</th>
      <th>Age</th>
      <th>Start date</th>
      <th>Salary</th>
    </tr>
  </thead>
  <tfoot>
    <tr>
      <th>Name</th>
      <th>Position</th>
      <th>Office</th>
      <th>Age</th>
      <th>Start date</th>
      <th>Salary</th>
    </tr>
  </tfoot>
  <tbody>
    <tr>
      <td>Tiger Nixon</td>
      <td>System Architect</td>
      <td>Edhinburgh</td>
      <td>61</td>
      <td>2011/04/25</td>
      <td>$320,800</td>
    </tr>
  </tbody>
{{/data-table}}

NOTE: The sample data and HTML markup were copied from the Zero Configuration example on the DataTables website.

Ember Data Example

The data-table component can be bound to Ember Data models. The Dummy application in the repository demonstrates this using ember-cli-mirage as a mock web API that serves the model data.

For example, assume that I have the following model named employee:

import Ember from 'ember';
import DS from 'ember-data';

export default DS.Model.extend({
  firstName: DS.attr('string'),
  lastName: DS.attr('string'),
  position: DS.attr('string'),
  office: DS.attr('string'),
  age: DS.attr('number'),
  extension: DS.attr('string'),
  startDate: DS.attr('date'),
  salary: DS.attr('number'),

  name: Ember.computed('firstName', 'lastName', function() {
    return `${this.get('firstName')} ${this.get('lastName')}`;
  })
});

I would then implement my route to load all of the employees from my web API:

import Ember from 'ember';

export default Ember.Route.extend({
  model() {
    return this.get('store').findAll('employee');
  }
});

In my template, I can then use the data-table component to render an HTML table listing the employee records. In my example, I am using the ember-array-helper addon to describe arrays in the template markup.

{{data-table data=model
             columns=(array
               (hash title="Name" property="name")
               (hash title="Position" property="position")
               (hash title="Office" property="office")
               (hash title="Age" property="age")
               (hash title="Start date" property="startDate")
               (hash title="Salary" property="salary")
             )}}

Data Renderer Helpers

If you try the above example, you'll notice that the start date column is rendered as a full date/time string. Because I'm in Arizona, I see date strings look like this:

Thu Nov 27 2008 17:00:00 GMT-0700 (MST)

I want something friendlier. I just want to display the date without the time and formatted such as "Jan 8, 2017". To do this, I can use the datetime-renderer helper to attach a custom data renderer to the start date column of my table and pass it the format string to use for rendering dates:

{{data-table data=model
             columns=(array
               (hash title="Name" property="name")
               (hash title="Position" property="position")
               (hash title="Office" property="office")
               (hash title="Age" property="age")
               (hash title="Start date" property="startDate" render=(datetime-renderer "MMM D YYYY"))
               (hash title="Salary" property="salary")
             )}}

Then the table formats, I can now see the start date formatted correctly.

The following data renderer helpers are defined:

Contributing to ember-datatables

I will happily accept contributions, bug fixes, and new features from the community. Please submit pull requests on a separate branch if you wish to contribute.

Creating a Development Workspace

  • git clone https://github.com/mfcollins3/ember-datatables.git
  • cd ember-datatables
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.