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
Post a Comment