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
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
*.name
.idea/encodings.xml
*.iml
.idea/misc.xml
*.xml
*.sh
test.*
.playwright-mcp
node_modules
yarn.lock
package-lock.json
2 changes: 1 addition & 1 deletion assets/js/template.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
window._config = {
isDebug: location.hash.slice(1) === 'is-debug' ||
['localhost', '127.0.0.1', 'dev.bootstrap-table.com'].includes(location.hostname),
cdnUrl: 'https://cdn.jsdelivr.net/npm/bootstrap-table@1.27.1/dist/',
cdnUrl: 'https://cdn.jsdelivr.net/npm/bootstrap-table@1.27.2/dist/',
localUrl: '../bootstrap-table/src/',
testUrl: '/src/'
}
Expand Down
4 changes: 2 additions & 2 deletions crud/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-table@1.27.1/dist/bootstrap-table.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-table@1.27.2/dist/bootstrap-table.min.css">
<style>
.mr10 { margin-right: 10px; }
.alert {
Expand All @@ -17,7 +17,7 @@
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.27.1/dist/bootstrap-table.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.27.2/dist/bootstrap-table.min.js"></script>
</head>
<body>
<div class="container">
Expand Down
38 changes: 38 additions & 0 deletions for-tests/extensions/export/export-customTypes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<script>
init({
title: 'Export Custom Types',
desc: 'Test exportTypes with multiple supported types.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'https://cdn.jsdelivr.net/npm/tableexport.jquery.plugin@1.29.0/tableExport.min.js',
'bootstrap-table.min.js',
'extensions/export/bootstrap-table-export.min.js'
]
})
</script>

<table id="table">
<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({
showExport: true,
exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
data: [
{ id: 1, name: 'Item 1', price: '$1' },
{ id: 2, name: 'Item 2', price: '$2' },
{ id: 3, name: 'Item 3', price: '$3' }
]
})
}
</script>
41 changes: 41 additions & 0 deletions for-tests/extensions/export/export-dataType-all.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script>
init({
title: 'Export Data Type All',
desc: 'Test exportDataType=all with pagination.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'https://cdn.jsdelivr.net/npm/tableexport.jquery.plugin@1.29.0/tableExport.min.js',
'bootstrap-table.min.js',
'extensions/export/bootstrap-table-export.min.js'
]
})
</script>

<table id="table">
<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 () {
const data = []

for (let i = 1; i <= 50; i++) {
data.push({ id: i, name: `Item ${i}`, price: `$${i}` })
}
$('#table').bootstrapTable({
showExport: true,
exportDataType: 'all',
pagination: true,
pageSize: 10,
data
})
}
</script>
39 changes: 39 additions & 0 deletions for-tests/extensions/export/export-dataType-selected.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script>
init({
title: 'Export Data Type Selected',
desc: 'Test exportDataType=selected with checkbox selection.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'https://cdn.jsdelivr.net/npm/tableexport.jquery.plugin@1.29.0/tableExport.min.js',
'bootstrap-table.min.js',
'extensions/export/bootstrap-table-export.min.js'
]
})
</script>

<table id="table">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<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({
showExport: true,
exportDataType: 'selected',
data: [
{ id: 1, name: 'Item 1', price: '$1', state: false },
{ id: 2, name: 'Item 2', price: '$2', state: false },
{ id: 3, name: 'Item 3', price: '$3', state: false }
]
})
}
</script>
44 changes: 44 additions & 0 deletions for-tests/extensions/export/export-events.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<script>
init({
title: 'Export Events',
desc: 'Test export-started and export-saved events.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'https://cdn.jsdelivr.net/npm/tableexport.jquery.plugin@1.29.0/tableExport.min.js',
'bootstrap-table.min.js',
'extensions/export/bootstrap-table-export.min.js'
]
})
</script>

<table id="table">
<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({
showExport: true,
data: [
{ id: 1, name: 'Item 1', price: '$1' },
{ id: 2, name: 'Item 2', price: '$2' }
]
})

$('#table').on('export-started.bs.table', function () {
window._exportStarted = true
})
$('#table').on('export-saved.bs.table', function (e, data) {
window._exportSaved = true
window._exportedData = data
})
}
</script>
41 changes: 41 additions & 0 deletions for-tests/extensions/export/export-fileName-function.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script>
init({
title: 'Export fileName Function',
desc: 'Test exportOptions.fileName as function.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'https://cdn.jsdelivr.net/npm/tableexport.jquery.plugin@1.29.0/tableExport.min.js',
'bootstrap-table.min.js',
'extensions/export/bootstrap-table-export.min.js'
]
})
</script>

<table id="table">
<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({
showExport: true,
exportOptions: {
fileName () {
return 'custom-export-name'
}
},
data: [
{ id: 1, name: 'Item 1', price: '$1' },
{ id: 2, name: 'Item 2', price: '$2' }
]
})
}
</script>
47 changes: 47 additions & 0 deletions for-tests/extensions/export/export-footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<script>
init({
title: 'Export Footer',
desc: 'Test exportFooter=true to include table footer in export.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'https://cdn.jsdelivr.net/npm/tableexport.jquery.plugin@1.29.0/tableExport.min.js',
'bootstrap-table.min.js',
'extensions/export/bootstrap-table-export.min.js'
]
})
</script>

<table id="table">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Name</th>
<th data-field="price">Price</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Total</td>
<td></td>
<td>$6</td>
</tr>
</tfoot>
</table>

<script>
function mounted () {
$('#table').bootstrapTable({
showExport: true,
showFooter: true,
exportFooter: true,
height: 400,
data: [
{ id: 1, name: 'Item 1', price: '$1' },
{ id: 2, name: 'Item 2', price: '$2' },
{ id: 3, name: 'Item 3', price: '$3' }
]
})
}
</script>
38 changes: 38 additions & 0 deletions for-tests/extensions/export/export-forceExport.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<script>
init({
title: 'Export forceExport',
desc: 'Test forceExport column option to export hidden columns.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'https://cdn.jsdelivr.net/npm/tableexport.jquery.plugin@1.29.0/tableExport.min.js',
'bootstrap-table.min.js',
'extensions/export/bootstrap-table-export.min.js'
]
})
</script>

<table id="table">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Name</th>
<th data-field="price">Price</th>
<th data-field="secret" data-visible="false" data-force-export="true">Secret</th>
</tr>
</thead>
</table>

<script>
function mounted () {
$('#table').bootstrapTable({
showExport: true,
data: [
{ id: 1, name: 'Item 1', price: '$1', secret: 's1' },
{ id: 2, name: 'Item 2', price: '$2', secret: 's2' },
{ id: 3, name: 'Item 3', price: '$3', secret: 's3' }
]
})
}
</script>
38 changes: 38 additions & 0 deletions for-tests/extensions/export/export-forceHide.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<script>
init({
title: 'Export forceHide',
desc: 'Test forceHide column option to hide columns from export.',
links: [
'bootstrap-table.min.css'
],
scripts: [
'https://cdn.jsdelivr.net/npm/tableexport.jquery.plugin@1.29.0/tableExport.min.js',
'bootstrap-table.min.js',
'extensions/export/bootstrap-table-export.min.js'
]
})
</script>

<table id="table">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Name</th>
<th data-field="price">Price</th>
<th data-field="icon" data-force-hide="true">Icon</th>
</tr>
</thead>
</table>

<script>
function mounted () {
$('#table').bootstrapTable({
showExport: true,
data: [
{ id: 1, name: 'Item 1', price: '$1', icon: '⭐' },
{ id: 2, name: 'Item 2', price: '$2', icon: '🔥' },
{ id: 3, name: 'Item 3', price: '$3', icon: '✅' }
]
})
}
</script>
Loading
Loading