-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
buttons.html
56 lines (54 loc) · 1.32 KB
/
buttons.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<script>
init({
title: 'Custom Buttons',
desc: 'Use `buttons` to add custom buttons which can be highly configured and sorted.',
links: ['bootstrap-table.min.css'],
scripts: ['bootstrap-table.min.js']
})
</script>
<table
id="table"
data-toggle="table"
data-height="460"
data-show-columns="true"
data-show-refresh="true"
data-show-columns-toggle-all="true"
data-show-pagination-switch="true"
data-show-toggle="true"
data-show-fullscreen="true"
data-buttons="buttons"
data-url="json/data1.json">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
<script>
function buttons () {
return {
btnUsersAdd: {
text: 'Highlight Users',
icon: 'fa-users',
event: function () {
alert('Do some stuff to e.g. search all users which has logged in the last week')
},
attributes: {
title: 'Search all users which has logged in the last week'
}
},
btnAdd: {
text: 'Add new row',
icon: 'fa-plus',
event: function () {
alert('Do some stuff to e.g. add a new row')
},
attributes: {
title: 'Add a new row to the table'
}
}
}
}
</script>