Skip to content

Commit a64f883

Browse files
committed
Add batch show/hide column example and update debug domain
1 parent ec957a5 commit a64f883

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

assets/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const isDebug = ['localhost', '127.0.0.1'].includes(location.hostname)
1+
const isDebug = ['localhost', '127.0.0.1', 'test.examples.wenzhixin.net.cn'].includes(location.hostname)
22
const { computed, createApp, onMounted, ref } = window.Vue
33

44
const Utils = {

assets/js/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
window._config = {
22
isDebug: location.hash.slice(1) === 'is-debug' ||
3-
['localhost', '127.0.0.1', 'dev.bootstrap-table.com'].includes(location.hostname),
3+
['localhost', '127.0.0.1', 'test.examples.wenzhixin.net.cn'].includes(location.hostname),
44
cdnUrl: 'https://cdn.jsdelivr.net/npm/bootstrap-table@1.27.2/dist/',
55
localUrl: '../bootstrap-table/src/',
66
testUrl: '/src/'

methods/show-hide-column.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
22
init({
33
title: 'Show/Hide Column',
4-
desc: 'Show/Hide the specified column:<br>`$table.bootstrapTable(\'showColumn\', \'name\')`<br>`$table.bootstrapTable(\'hideColumn\', \'name\')`.',
4+
desc: 'Show/Hide the specified column:<br>`$table.bootstrapTable(\'showColumn\', \'name\')`<br>`$table.bootstrapTable(\'hideColumn\', \'name\')`<br><br>Show/Hide multiple columns:<br>`$table.bootstrapTable(\'showColumn\', [\'name\', \'price\'])`<br>`$table.bootstrapTable(\'hideColumn\', [\'name\', \'price\'])`.',
55
links: ['bootstrap-table.min.css'],
66
scripts: ['bootstrap-table.min.js']
77
})
@@ -21,6 +21,18 @@
2121
>
2222
hideColumn
2323
</button>
24+
<button
25+
id="button3"
26+
class="btn btn-secondary"
27+
>
28+
showColumn (batch)
29+
</button>
30+
<button
31+
id="button4"
32+
class="btn btn-secondary"
33+
>
34+
hideColumn (batch)
35+
</button>
2436
</div>
2537
<table
2638
id="table"
@@ -50,6 +62,8 @@
5062
const $table = $('#table')
5163
const $button = $('#button')
5264
const $button2 = $('#button2')
65+
const $button3 = $('#button3')
66+
const $button4 = $('#button4')
5367

5468
function mounted () {
5569
$button.click(function () {
@@ -58,5 +72,11 @@
5872
$button2.click(function () {
5973
$table.bootstrapTable('hideColumn', 'name')
6074
})
75+
$button3.click(function () {
76+
$table.bootstrapTable('showColumn', ['name', 'price'])
77+
})
78+
$button4.click(function () {
79+
$table.bootstrapTable('hideColumn', ['name', 'price'])
80+
})
6181
}
6282
</script>

0 commit comments

Comments
 (0)