1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < title > showRow/hideRow</ 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/showRow-hideRow.html " target ="_blank "> View Source on GitHub</ a >
18
+ </ div >
19
+ < h1 > showRow/hideRow</ h1 >
20
+ < p >
21
+ Show/Hide the specified row.< br >
22
+ < code > $table.bootstrapTable('showRow', 1);</ code > < br >
23
+ < code > $table.bootstrapTable('hideRow', 1);</ code >
24
+ </ p >
25
+ < div id ="toolbar ">
26
+ < button id ="button " class ="btn btn-default "> Show Row</ button >
27
+ < button id ="button2 " class ="btn btn-default "> Hide Row</ 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 ( 'showRow' , 1 ) ;
51
+ } ) ;
52
+
53
+ $button2 . click ( function ( ) {
54
+ $table . bootstrapTable ( 'hideRow' , 1 ) ;
55
+ } ) ;
56
+ } ) ;
57
+ </ script >
58
+ </ body >
59
+ </ html >
0 commit comments