Skip to content

Commit

Permalink
Merge pull request #533 from xanish/feature/get-footer-data
Browse files Browse the repository at this point in the history
Added example for getFooterData
  • Loading branch information
wenzhixin authored Oct 1, 2024
2 parents dc0e982 + 0204825 commit ccb133f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
<li><a href="#methods/expand-collapse-row.html">Expand/Collapse Row</a></li>
<li><a href="#methods/filter-by.html">Filter By</a></li>
<li><a href="#methods/get-data.html">Get Data</a></li>
<li><a href="#methods/get-footer-data.html">Get Footer Data</a></li>
<li><a href="#methods/get-hidden-rows.html">Get Hidden Rows</a></li>
<li><a href="#methods/get-options.html">Get Options</a></li>
<li><a href="#methods/get-row-by-unique-id.html">Get Row By Unique Id</a></li>
Expand Down
41 changes: 41 additions & 0 deletions methods/get-footer-data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script>
init({
title: 'Get Footer Data',
desc: 'Get the loaded data of the footer: `$table.bootstrapTable(\'getFooterData\')`.',
links: ['bootstrap-table.min.css'],
scripts: ['bootstrap-table.min.js']
})
</script>

<div id="toolbar">
<button id="button" class="btn btn-secondary">getFooterData</button>
</div>
<table
id="table"
data-toggle="table"
data-toolbar="#toolbar"
data-height="460"
data-show-footer="true"
data-pagination="true"
data-side-pagination="server"
data-data-field="items"
data-url="json/footerField.json">
<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('getFooterData')))
})
}
</script>

0 comments on commit ccb133f

Please sign in to comment.