Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created April 17, 2020 13:57
Show Gist options
  • Save Raynos/e86aedc6feb0f20d26fc82e9717ae002 to your computer and use it in GitHub Desktop.
Save Raynos/e86aedc6feb0f20d26fc82e9717ae002 to your computer and use it in GitHub Desktop.
class DataTableExample extends DataTable {
computeRowValues (row) {
return [
row.message,
new Date(row.timestamp).toGMTString()
]
}
computeRowHeaders () {
return [{
name: 'Message', key: 'message', type: 'string'
}, {
name: 'Creation Time', key: 'timestamp', type: 'number'
}]
}
}
Tonic.add(DataTableExample)
class DataTableExample extends DataTable {
constructor () {
super({
rowHeaders: [{
name: 'Message', key: 'message', type: 'string'
}, {
name: 'Creation Time', key: 'timestamp', type: 'number'
}]
})
}
computeRowValues (row) {
return [
row.message,
new Date(row.timestamp).toGMTString()
]
}
}
Tonic.add(DataTableExample)
class DataTableExample extends DataTable {
willConnect () {
this.setRowHeaders([{
name: 'Message', key: 'message', type: 'string'
}, {
name: 'Creation Time', key: 'timestamp', type: 'number'
}])
}
computeRowValues (row) {
return [
row.message,
new Date(row.timestamp).toGMTString()
]
}
}
Tonic.add(DataTableExample)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment