-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
get-data.html
39 lines (36 loc) · 908 Bytes
/
get-data.html
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
<script>
init({
title: 'Get Data',
desc: 'Get the loaded data of table: `$table.bootstrapTable(\'getData\')`.',
links: ['bootstrap-table.min.css'],
scripts: ['bootstrap-table.min.js']
})
</script>
<div id="toolbar">
<button id="button" class="btn btn-secondary">getData</button>
</div>
<table
id="table"
data-toggle="table"
data-toolbar="#toolbar"
data-height="460"
data-side-pagination="server"
data-pagination="true"
data-url="https://examples.wenzhixin.net.cn/examples/bootstrap_table/data">
<thead>
<tr>
<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')
var $button = $('#button')
function mounted() {
$button.click(function () {
alert(JSON.stringify($table.bootstrapTable('getData')))
})
}
</script>