Skip to content

Jake2000/ember-ds-table

Repository files navigation

Ember-ds-table

Installation

ember install ember-ds-table

Usage

Set up the table properties,

// ../controllers/application.js
columns:  [
  {
      title: '#',
      path: 'id'
  },
  {
      title: 'Avatar',
      path: 'avatar',
      component: 'user-avatar'
  },
  {
      title: 'First Name',
      path: 'firstName'
  },
  {
      title: 'Last Name',
      path: 'lastName'
  },
  {
      title: 'Address',
      path: 'address'
  },
  {
      title: 'State',
      path: 'state'
  },
  {
      title: 'Country',
      path: 'country'
  }
],
<!-- ../templates/application.hbs -->

{{ds-table
  modelName='user'
  columns=columns
}}
<!-- ../templates/components/user-avatar.hbs -->

<img src={{value}} style="width:30px;height:30px;border-radius:50%;">