-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add export extension test HTML pages for Cypress tests #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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: [ | ||
|
wenzhixin marked this conversation as resolved.
|
||
| { id: 1, name: 'Item 1', price: '$1' }, | ||
| { id: 2, name: 'Item 2', price: '$2' }, | ||
| { id: 3, name: 'Item 3', price: '$3' } | ||
| ] | ||
| }) | ||
| } | ||
| </script> | ||
| 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: [ | ||
|
wenzhixin marked this conversation as resolved.
|
||
| '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> | ||
| 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: [ | ||||||||||
|
||||||||||
| scripts: [ | |
| scripts: [ | |
| 'FileSaver.min.js', | |
| 'tableExport.min.js', |
| 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: [ | ||||||||||
|
||||||||||
| scripts: [ | |
| scripts: [ | |
| 'https://unpkg.com/file-saver/dist/FileSaver.min.js', | |
| 'https://unpkg.com/tableexport.jquery.plugin/tableExport.min.js', |
| 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: [ | ||||||||||
|
||||||||||
| scripts: [ | |
| scripts: [ | |
| 'FileSaver.min.js', | |
| 'tableExport.min.js', |
| 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: [ | ||||||||||||
|
||||||||||||
| scripts: [ | |
| scripts: [ | |
| 'https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js', | |
| 'https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.core.min.js', | |
| 'https://unpkg.com/tableexport.jquery.plugin/tableExport.min.js', |
| 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: [ | ||
|
wenzhixin marked this conversation as resolved.
|
||
| '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> | ||
| 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: [ | ||
|
wenzhixin marked this conversation as resolved.
|
||
| '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> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <script> | ||
| init({ | ||
| title: 'Export Method', | ||
| desc: 'Test exportTable() method for programmatic export.', | ||
| links: [ | ||
| 'bootstrap-table.min.css' | ||
| ], | ||
| scripts: [ | ||
|
wenzhixin marked this conversation as resolved.
|
||
| '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> | ||
|
|
||
| <button id="btn-export" class="btn btn-secondary">Export CSV</button> | ||
|
|
||
| <script> | ||
| function mounted () { | ||
| $('#table').bootstrapTable({ | ||
| data: [ | ||
| { id: 1, name: 'Item 1', price: '$1' }, | ||
| { id: 2, name: 'Item 2', price: '$2' } | ||
| ] | ||
| }) | ||
|
|
||
| $('#btn-export').click(function () { | ||
| $('#table').bootstrapTable('exportTable', { type: 'csv' }) | ||
| }) | ||
| } | ||
| </script> | ||
Uh oh!
There was an error while loading. Please reload this page.