Donate

Bootstrap-Table-Export.js Not Exporting Bootstrap Table Data

Normally, exporting a Bootstrap-Table by Wenzhixin using Bootstrap-Table-Export.js plugin works. But in my case, it's returning an empty document whether Excel,CSV, XML or JSON format. I did some debugging on the plugin itself and found out that it doesn't export if the main table contains child table(s). A fix that I came up was to remove the child tables from the table object before passing it to the tableExport.js plugin. The solutions is applied in the doExport() function of Bootstrap-Table-Export.js plugin.
doExport = function () {
 //remove child table elements. 
 var length = that.$tableBody.children('table').find('table').length;
 if (length > 0) {
  that.$tableBody.children('table').find('table').remove();
 }

 that.$el.tableExport($.extend({}, that.options.exportOptions, {
  type: type,
  escape: false
 }));
};

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input