Repository navigation
Expand file tree
/
Copy path383.html
More file actions
67 lines (63 loc) · 1.49 KB
/
Copy path383.html
File metadata and controls
67 lines (63 loc) · 1.49 KB
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
57
58
59
60
61
62
63
64
65
66
67
<script>
init({
title: 'Issue #383',
desc: 'Use Flat UI to style the checkboxes(<a href="https://github.com/wenzhixin/bootstrap-table/issues/383" target="_blank">#383</a>.)',
links: [
'https://cdnjs.cloudflare.com/ajax/libs/flat-ui/2.3.0/css/flat-ui.min.css',
'bootstrap-table.min.css'
],
scripts: [
'https://cdnjs.cloudflare.com/ajax/libs/flat-ui/2.3.0/js/flat-ui.min.js',
'bootstrap-table.min.js'
]
})
</script>
<style>
.checkbox {
padding-left: 22px;
margin-bottom: 16px;
}
.caret {
display: none;
}
.pull-left {
float: left;
}
.pull-right {
float: right;
}
.bootstrap-table .fixed-table-pagination > .pagination ul.pagination a {
padding: 12px 10px;
}
.page-item.active .page-link {
background-color: #1abc9c;
border: none;
}
</style>
<table
id="table"
data-toggle="table"
data-pagination="true"
data-url="json/data1.json">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="id">ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
<script>
var $table = $('#table')
function mounted() {
$table.on('post-body.bs.table', function () {
$(':checkbox').each(function () {
if (!$(this).parent().hasClass('checkbox')) {
$(this).wrap('<label class="checkbox"></label>').radiocheck()
}
})
$('.dropdown-toggle').dropdown()
})
}
</script>