Skip to content

Commit 949c355

Browse files
committed
Add showColumn/hideColumn example.
1 parent 287b947 commit 949c355

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<li><a href="methods/resetView.html">resetView</a></li>
6464
<li><a href="methods/destroy.html">destroy</a></li>
6565
<li><a href="methods/showLoading-hideLoading.html">showLoading/hideLoading</a></li>
66+
<li><a href="methods/showColumn-hideCoulumn.html">showColumn/hideCoulumn</a></li>
6667
<li><a href="methods/selectPage-prevPage-nextPage.html">selectPage/prevPage/nextPage</a></li>
6768
</ul>
6869
</li>

index.html.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<li><a href="methods/resetView.html">resetView</a></li>
6464
<li><a href="methods/destroy.html">destroy</a></li>
6565
<li><a href="methods/showLoading-hideLoading.html">showLoading/hideLoading</a></li>
66+
<li><a href="methods/showColumn-hideCoulumn.html">showColumn/hideCoulumn</a></li>
6667
<li><a href="methods/selectPage-prevPage-nextPage.html">selectPage/prevPage/nextPage</a></li>
6768
</ul>
6869
</li>

methods/showColumn-hideCoulumn.html

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>showColumn/hideCoulumn</title>
5+
<meta charset="utf-8">
6+
<link rel="stylesheet" href="../assets/bootstrap/css/bootstrap.min.css">
7+
<link rel="stylesheet" href="../assets/bootstrap-table/src/bootstrap-table.css">
8+
<link rel="stylesheet" href="../assets/examples.css">
9+
<script src="../assets/jquery.min.js"></script>
10+
<script src="../assets/bootstrap/js/bootstrap.min.js"></script>
11+
<script src="../assets/bootstrap-table/src/bootstrap-table.js"></script>
12+
<script src="../ga.js"></script>
13+
</head>
14+
<body>
15+
<div class="container">
16+
<div class="ribbon">
17+
<a href="https://github.com/wenzhixin/bootstrap-table-examples/blob/master/methods/showColumn-hideCoulumn.html" target="_blank">View Source on GitHub</a>
18+
</div>
19+
<h1>showColumn/hideCoulumn</h1>
20+
<p>
21+
Show/Hide the specified column.<br>
22+
<code>$table.bootstrapTable('showColumn', 'name');</code><br>
23+
<code>$table.bootstrapTable('hideColumn', 'name');</code>
24+
</p>
25+
<div id="toolbar">
26+
<button id="button" class="btn btn-default">showColumn</button>
27+
<button id="button2" class="btn btn-default">hideCoulumn</button>
28+
</div>
29+
<table id="table"
30+
data-toggle="table"
31+
data-toolbar="#toolbar"
32+
data-height="460"
33+
data-url="../json/data1.json">
34+
<thead>
35+
<tr>
36+
<th data-field="id">ID</th>
37+
<th data-field="name">Item Name</th>
38+
<th data-field="price">Item Price</th>
39+
</tr>
40+
</thead>
41+
</table>
42+
</div>
43+
<script>
44+
var $table = $('#table'),
45+
$button = $('#button'),
46+
$button2 = $('#button2');
47+
48+
$(function () {
49+
$button.click(function () {
50+
$table.bootstrapTable('showColumn', 'name');
51+
});
52+
$button2.click(function () {
53+
$table.bootstrapTable('hideColumn', 'name');
54+
});
55+
});
56+
</script>
57+
</body>
58+
</html>

0 commit comments

Comments
 (0)