Skip to content

Commit 62f9843

Browse files
committed
Add getRowByUniqueId example.
1 parent 06f2abf commit 62f9843

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

methods/getRowByUniqueId.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>getRowByUniqueId</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+
<h1>getRowByUniqueId</h1>
17+
<p>
18+
Get data from table, the row that contains the id passed by parameter:
19+
<code>$table.bootstrapTable('getRowByUniqueId', 1);</code>
20+
</p>
21+
<div id="toolbar">
22+
<button id="button" class="btn btn-default">getRowByUniqueId</button>
23+
</div>
24+
<table id="table"
25+
data-toggle="table"
26+
data-toolbar="#toolbar"
27+
data-height="460"
28+
data-unique-id="id"
29+
data-url="../json/data1.json">
30+
<thead>
31+
<tr>
32+
<th data-field="id">ID</th>
33+
<th data-field="name">Item Name</th>
34+
<th data-field="price">Item Price</th>
35+
</tr>
36+
</thead>
37+
</table>
38+
</div>
39+
<script>
40+
var $table = $('#table'),
41+
$button = $('#button');
42+
43+
$(function () {
44+
$button.click(function () {
45+
alert('getRowByUniqueId: ' + JSON.stringify($table.bootstrapTable('getRowByUniqueId', 1)));
46+
});
47+
});
48+
</script>
49+
</body>
50+
</html>

0 commit comments

Comments
 (0)