Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions for-tests/extensions/print/print-printFilter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script>
init({
title: 'Print printFilter',
desc: 'Test printFilter column option.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'bootstrap-table.min.js',
'extensions/print/bootstrap-table-print.min.js'
]
})
</script>

<table
id="table"
data-show-print="true">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Name</th>
<th data-field="status" data-print-filter="active">Status</th>
</tr>
</thead>
</table>

<script>
function mounted () {
$('#table').bootstrapTable({
data: [
{ id: 1, name: 'Item 1', status: 'active' },
{ id: 2, name: 'Item 2', status: 'inactive' },
{ id: 3, name: 'Item 3', status: 'active' }
]
})
}
</script>
42 changes: 42 additions & 0 deletions for-tests/extensions/print/print-printFormatter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<script>
init({
title: 'Print printFormatter',
desc: 'Test printFormatter column option.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'bootstrap-table.min.js',
'extensions/print/bootstrap-table-print.min.js'
]
})
</script>

<table
id="table"
data-show-print="true">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Name</th>
<th data-field="price"
data-print-formatter="priceFormatter">Price</th>
</tr>
</thead>
</table>

<script>
function mounted () {
$('#table').bootstrapTable({
data: [
{ id: 1, name: 'Item 1', price: 100 },
{ id: 2, name: 'Item 2', price: 200 },
{ id: 3, name: 'Item 3', price: 300 }
]
})
}

window.priceFormatter = function (value) {
return `$${value.toFixed(2)}`
}
</script>
37 changes: 37 additions & 0 deletions for-tests/extensions/print/print-printIgnore.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script>
init({
title: 'Print printIgnore',
desc: 'Test printIgnore column option.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'bootstrap-table.min.js',
'extensions/print/bootstrap-table-print.min.js'
]
})
</script>

<table
id="table"
data-show-print="true">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Name</th>
<th data-field="price" data-print-ignore="true">Price</th>
</tr>
</thead>
</table>

<script>
function mounted () {
$('#table').bootstrapTable({
data: [
{ id: 1, name: 'Item 1', price: '$100' },
{ id: 2, name: 'Item 2', price: '$200' },
{ id: 3, name: 'Item 3', price: '$300' }
]
})
}
</script>
39 changes: 39 additions & 0 deletions for-tests/extensions/print/print-printSort.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script>
init({
title: 'Print printSort',
Comment thread
wenzhixin marked this conversation as resolved.
desc: 'Test printSortColumn and printSortOrder options.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'bootstrap-table.min.js',
'extensions/print/bootstrap-table-print.min.js'
]
})
</script>

<table
id="table"
data-show-print="true"
data-print-sort-column="name"
data-print-sort-order="desc">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Name</th>
<th data-field="price">Price</th>
</tr>
</thead>
</table>

<script>
function mounted () {
$('#table').bootstrapTable({
data: [
{ id: 1, name: 'Banana', price: '$100' },
{ id: 2, name: 'Apple', price: '$200' },
{ id: 3, name: 'Cherry', price: '$300' }
]
})
}
</script>
40 changes: 40 additions & 0 deletions for-tests/extensions/print/print-showFooter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<script>
init({
title: 'Print showFooter',
desc: 'Test showFooter with print output.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'bootstrap-table.min.js',
'extensions/print/bootstrap-table-print.min.js'
]
})
</script>

<table
id="table"
data-show-print="true"
data-show-footer="true">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Name</th>
<th data-field="price" data-footer-formatter="totalFormatter">Price</th>
</tr>
</thead>
</table>

<script>
Comment thread
wenzhixin marked this conversation as resolved.
function mounted () {
$('#table').bootstrapTable({
data: [
{ id: 1, name: 'Item 1', price: 100 },
{ id: 2, name: 'Item 2', price: 200 },
{ id: 3, name: 'Item 3', price: 300 }
]
})
}

window.totalFormatter = data => `$${data.reduce((sum, item) => sum + item.price, 0)}`
</script>
37 changes: 37 additions & 0 deletions for-tests/extensions/print/print.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script>
init({
title: 'Print showPrint',
desc: 'Test showPrint option.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'bootstrap-table.min.js',
'extensions/print/bootstrap-table-print.min.js'
]
})
</script>

<table
id="table"
data-show-print="true">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Name</th>
<th data-field="price">Price</th>
</tr>
</thead>
</table>

<script>
function mounted () {
$('#table').bootstrapTable({
data: [
{ id: 1, name: 'Item 1', price: '$100' },
{ id: 2, name: 'Item 2', price: '$200' },
{ id: 3, name: 'Item 3', price: '$300' }
]
})
}
</script>
Loading