1 |
|
2 |
|
3 |
|
4 |
|
5 | Template.define('users_row_template', {
|
6 | edit: (btn, user) => {
|
7 | btn.href += user.index;
|
8 | },
|
9 | remove: (btn, user) => {
|
10 | btn.href += user.index;
|
11 | btn.addEventListener('click', (e) => {
|
12 | e.preventDefault();
|
13 |
|
14 |
|
15 | if (confirm('Are you sure?')) {
|
16 | window.location = btn.href;
|
17 | }
|
18 | })
|
19 | }
|
20 | });
|
21 |
|
22 | DataTable.onRedraw(document.getElementsByTagName('datatable')[0], (data) => {
|
23 | console.info('Switched to page ' + data.current_page);
|
24 | console.info('First user name is:' + data.data[0].name);
|
25 | });
|