Skip to content

Instantly share code, notes, and snippets.

@definitelynotsoftware
Created November 1, 2017 14:03
Show Gist options
  • Save definitelynotsoftware/4e1d45adb7985514592580f0c0f2e9e2 to your computer and use it in GitHub Desktop.
Save definitelynotsoftware/4e1d45adb7985514592580f0c0f2e9e2 to your computer and use it in GitHub Desktop.
<!-- Table -->
<datatable sortable
resource.bind="mold"
limit.bind="limit"
select.call="selected($event)"
columns.bind="moldColumns"
actions.bind="actions"
repository.bind="moldRepository">
</datatable>
<pager resource.bind="mold"
page.bind="page"
pagerange.bind="3"
click.delegate="pageChanged($event)">
</pager>
import { Entity, type, resource } from 'aurelia-orm';
@resource('mold')
export class Mold extends Entity {
@type('number')
Id = null;
SerialNumber = null;
LastUpdatedDate = null;
CurrentStatus = null;
WallThickness = null;
StampedSize = null;
constructor() {
super();
}
}
this.moldRepository = this.entityManager.getRepository('mold');
this.moldColumns = [
{
property: 'SerialNumber',
label: 'Serial #',
valueConverters: ['upper']
},
{
property: 'LastUpdatedDate',
label: 'Last Updated Date',
valueConverters: ['dateFormat']
}
];
this.actions = [
{
icon: 'plus', // font-awesome icon name
title: 'Add Record', // button title if `icon` is not set
type: 'primary', // bootstrap button type
action: (mold) => {
this.openNewRecordDialog(mold);
}
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment