Skip to content

Commit ca7e44a

Browse files
committed
Add print extension test pages
1 parent 8bae62f commit ca7e44a

6 files changed

Lines changed: 237 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<script>
2+
init({
3+
title: 'Print printFilter',
4+
desc: 'Test printFilter column option.',
5+
links: [
6+
'bootstrap-table.min.css'
7+
],
8+
scripts: [
9+
'bootstrap-table.min.js',
10+
'extensions/print/bootstrap-table-print.min.js'
11+
]
12+
})
13+
</script>
14+
15+
<table
16+
id="table"
17+
data-show-print="true">
18+
<thead>
19+
<tr>
20+
<th data-field="id">ID</th>
21+
<th data-field="name">Name</th>
22+
<th data-field="status" data-print-filter="active">Status</th>
23+
</tr>
24+
</thead>
25+
</table>
26+
27+
<script>
28+
function mounted () {
29+
$('#table').bootstrapTable({
30+
data: [
31+
{ id: 1, name: 'Item 1', status: 'active' },
32+
{ id: 2, name: 'Item 2', status: 'inactive' },
33+
{ id: 3, name: 'Item 3', status: 'active' }
34+
]
35+
})
36+
}
37+
</script>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<script>
2+
init({
3+
title: 'Print printFormatter',
4+
desc: 'Test printFormatter column option.',
5+
links: [
6+
'bootstrap-table.min.css'
7+
],
8+
scripts: [
9+
'bootstrap-table.min.js',
10+
'extensions/print/bootstrap-table-print.min.js'
11+
]
12+
})
13+
</script>
14+
15+
<table
16+
id="table"
17+
data-show-print="true">
18+
<thead>
19+
<tr>
20+
<th data-field="id">ID</th>
21+
<th data-field="name">Name</th>
22+
<th data-field="price"
23+
data-print-formatter="priceFormatter">Price</th>
24+
</tr>
25+
</thead>
26+
</table>
27+
28+
<script>
29+
function mounted () {
30+
$('#table').bootstrapTable({
31+
data: [
32+
{ id: 1, name: 'Item 1', price: 100 },
33+
{ id: 2, name: 'Item 2', price: 200 },
34+
{ id: 3, name: 'Item 3', price: 300 }
35+
]
36+
})
37+
}
38+
39+
window.priceFormatter = function (value) {
40+
return `$${value.toFixed(2)}`
41+
}
42+
</script>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<script>
2+
init({
3+
title: 'Print printIgnore',
4+
desc: 'Test printIgnore column option.',
5+
links: [
6+
'bootstrap-table.min.css'
7+
],
8+
scripts: [
9+
'bootstrap-table.min.js',
10+
'extensions/print/bootstrap-table-print.min.js'
11+
]
12+
})
13+
</script>
14+
15+
<table
16+
id="table"
17+
data-show-print="true">
18+
<thead>
19+
<tr>
20+
<th data-field="id">ID</th>
21+
<th data-field="name">Name</th>
22+
<th data-field="price" data-print-ignore="true">Price</th>
23+
</tr>
24+
</thead>
25+
</table>
26+
27+
<script>
28+
function mounted () {
29+
$('#table').bootstrapTable({
30+
data: [
31+
{ id: 1, name: 'Item 1', price: '$100' },
32+
{ id: 2, name: 'Item 2', price: '$200' },
33+
{ id: 3, name: 'Item 3', price: '$300' }
34+
]
35+
})
36+
}
37+
</script>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<script>
2+
init({
3+
title: 'Print printSort',
4+
desc: 'Test printSortColumn and printSortOrder options.',
5+
links: [
6+
'bootstrap-table.min.css'
7+
],
8+
scripts: [
9+
'bootstrap-table.min.js',
10+
'extensions/print/bootstrap-table-print.min.js'
11+
]
12+
})
13+
</script>
14+
15+
<table
16+
id="table"
17+
data-show-print="true"
18+
data-print-sort-column="name"
19+
data-print-sort-order="desc">
20+
<thead>
21+
<tr>
22+
<th data-field="id">ID</th>
23+
<th data-field="name">Name</th>
24+
<th data-field="price">Price</th>
25+
</tr>
26+
</thead>
27+
</table>
28+
29+
<script>
30+
function mounted () {
31+
$('#table').bootstrapTable({
32+
data: [
33+
{ id: 1, name: 'Banana', price: '$100' },
34+
{ id: 2, name: 'Apple', price: '$200' },
35+
{ id: 3, name: 'Cherry', price: '$300' }
36+
]
37+
})
38+
}
39+
</script>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<script>
2+
init({
3+
title: 'Print ShowFooter',
4+
desc: 'Test showFooter with print output contains tfoot tag.',
5+
links: [
6+
'bootstrap-table.min.css'
7+
],
8+
scripts: [
9+
'bootstrap-table.min.js',
10+
'extensions/print/bootstrap-table-print.min.js'
11+
]
12+
})
13+
</script>
14+
15+
<table
16+
id="table"
17+
data-show-print="true"
18+
data-show-footer="true">
19+
<thead>
20+
<tr>
21+
<th data-field="id">ID</th>
22+
<th data-field="name">Name</th>
23+
<th data-field="price" data-print-ignore="true">Price</th>
24+
</tr>
25+
</thead>
26+
<tfoot>
27+
<tr>
28+
<th>3</th>
29+
<th>Total</th>
30+
<th>$600</th>
31+
</tr>
32+
</tfoot>
33+
</table>
34+
35+
<script>
36+
function mounted () {
37+
$('#table').bootstrapTable({
38+
data: [
39+
{ id: 1, name: 'Item 1', price: '$100' },
40+
{ id: 2, name: 'Item 2', price: '$200' },
41+
{ id: 3, name: 'Item 3', price: '$300' }
42+
]
43+
})
44+
}
45+
</script>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<script>
2+
init({
3+
title: 'Print ShowPrint',
4+
desc: 'Test showPrint option.',
5+
links: [
6+
'bootstrap-table.min.css'
7+
],
8+
scripts: [
9+
'bootstrap-table.min.js',
10+
'extensions/print/bootstrap-table-print.min.js'
11+
]
12+
})
13+
</script>
14+
15+
<table
16+
id="table"
17+
data-show-print="true">
18+
<thead>
19+
<tr>
20+
<th data-field="id">ID</th>
21+
<th data-field="name">Name</th>
22+
<th data-field="price">Price</th>
23+
</tr>
24+
</thead>
25+
</table>
26+
27+
<script>
28+
function mounted () {
29+
$('#table').bootstrapTable({
30+
data: [
31+
{ id: 1, name: 'Item 1', price: '$100' },
32+
{ id: 2, name: 'Item 2', price: '$200' },
33+
{ id: 3, name: 'Item 3', price: '$300' }
34+
]
35+
})
36+
}
37+
</script>

0 commit comments

Comments
 (0)