Created
November 1, 2017 14:03
-
-
Save definitelynotsoftware/4e1d45adb7985514592580f0c0f2e9e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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