-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathexport-fileName-function.html
More file actions
41 lines (39 loc) · 889 Bytes
/
export-fileName-function.html
File metadata and controls
41 lines (39 loc) · 889 Bytes
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
40
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>