-
-
Save Raynos/e86aedc6feb0f20d26fc82e9717ae002 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
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