-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathevents.mjs
37 lines (35 loc) · 962 Bytes
/
events.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Grid } from '../../dist/main.esm.js'
export default {
name: 'Events',
components: {
Grid
},
data() {
return {
columns: ['Name', 'Email', 'Phone Number'],
sort: true,
search: true,
rows: [
['John', '[email protected]', '(353) 01 222 3333'],
['Mark', '[email protected]', '(01) 22 888 4444'],
['Eoin', '[email protected]', '(05) 10 878 5554'],
['Nisen', '[email protected]', '313 333 1923']
]
}
},
mounted() {
this.$nextTick(() => {
if (this.$refs.myGrid && this.$refs.myGrid.grid) {
this.$refs.myGrid.grid.on('rowClick', (...args) => {
console.log(`row: ${JSON.stringify(args)}`)
})
this.$refs.myGrid.grid.on('cellClick', (...args) => {
console.log(`cell: ${JSON.stringify(args)}`)
})
}
})
},
template: `
<div><grid :columns="columns" :rows="rows" :sort="sort" ref="myGrid"></grid></div>
`
}