Skip to content

Replace deprecated tableExport.jquery.plugin with built-in exporter - #8539

Open
wenzhixin wants to merge 8 commits into
developfrom
feature/bootstrap-table-export
Open

wenzhixin wants to merge 8 commits into
developfrom
feature/bootstrap-table-export

Conversation

@wenzhixin

Copy link
Copy Markdown
Owner

🤔Type of Request

  • Bug fix
  • New feature
  • Improvement
  • Documentation
  • Other

🔗Resolves an issue?
Fix #8070

Re-lands #8071 (merged too early and then taken out of develop), taking over from @marktech0813 who has been unresponsive since 2025-11-19. All review feedback from #8071 is addressed, original commits are kept.

📝Changelog

  • Core

  • Extensions

  • Update(export): Removed the deprecated tableExport.jquery.plugin dependency in favor of a built-in exporter (jQuery 4 compatible), with no external plugin required anymore.

  • Update(export): Export data is now collected from the table data model instead of the rendered DOM, so values match the displayed content (formatters applied, HTML stripped).

  • Update(export): Supported types are json, xml, csv, txt, sql, excel; png, pdf, xlsx, doc and powerpoint are no longer supported by the built-in exporter.

  • Update(export): Unsupported types are skipped: exportTable() returns false, warns and triggers no events.

  • Update(export): Hardened the xml/sql output: sanitized xml tag names, escaped sql identifiers, and empty sql content instead of an invalid INSERT statement.

  • Update(export): The basic data type exports the current page only; exportFooter appends the footer as the last row using footerFormatter.

💡Example(s)?
Covered by the new unit tests (tests/extensions/export.test.js, 28 cases) and the rewritten cypress tests which assert on the generated file content instead of the removed plugin.

☑️Self Check before Merge

⚠️ Please check all items below before reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed (release changelog is maintained on changelog/unreleased-1.28.0)

marktech0813 and others added 8 commits November 13, 2025 16:42
Updated CONTRIBUTING.md to reflect that Table Export is now built-in.
Updated docs in site/src/pages/docs/extensions/export.mdx:
- Removed plugin requirement.
- Documented built-in options (fileName, csvDelimiter, tableName) and supported types.
Implemented a built-in exporter in src/extensions/export/bootstrap-table-export.js that:
- Supports types: json, xml, csv, txt, sql, and maps excel to CSV (.xls).
- Preserves existing behaviors: fileName function support, footer export, column visibility (forceExport/forceHide), selected/all/basic export, and detail-view column exclusion via ignoreColumn.
- Uses safe Blob download, avoiding deprecated/vulnerable plugin code.

Contribution by Gittensor, learn more at https://gittensor.io/
Refactor CSV escaping and table matrix collection logic for improved readability and null handling.

- Using strict equality checks for null/undefined.
- Adding required blank lines between declarations and control statements.
- Removing unnecessary arrow parens and extra parentheses.
- Using template literals instead of string concatenation.
- Ensuring single quotes and proper brace style.
- Splitting multi-statements onto separate lines.
Collect export data from the table data model instead of scraping the
rendered DOM, so the exported values match what is rendered by the table
formatters while keeping the original value types available.

- validate the export type up front and skip unsupported ones without
  triggering any export event
- export the current page only for the basic data type
- sanitize xml element names and escape sql identifiers
- return empty sql content instead of an invalid INSERT statement

Co-authored-by: marktech0813 <178346048+marktech0813@users.noreply.github.com>
Cover the built-in exporter with unit tests through a mocked download and
rewrite the cypress export tests, which still asserted that the removed
tableExport.jquery.plugin was called.

Co-authored-by: marktech0813 <178346048+marktech0813@users.noreply.github.com>
Document the exportOptions supported by the built-in exporter, the removed
plugin options and types, the basic data type exporting the current page
and the excel type generating CSV content with an xls extension.

Co-authored-by: marktech0813 <178346048+marktech0813@users.noreply.github.com>
@wenzhixin
wenzhixin requested a balanced review from Copilot October 25, 2026 05:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tableExport.jquery.plugin deprecated

3 participants