Closed nvcastelli closed 1 year ago
Sorry for this late reply. This seems to be an issue related to bootstrap-table. Please ask your question on their page again.
Just to confirm, in the tableexport.js file, I see that the proper option for download is being passed into the file from the bootstrap-table-export.js file, in this case 'json' in the image shared below . Somewhere in the tableexport.js file the code is defaulting to the defaults.format of formats: ["xlsx", "csv", "txt"],
at around line 153. Could you explain why this isn't from functionality in tableexport.js when it looks like it's receiving the correct file type from the bootstrap table?
My expectation is that filetype would be determined from the type property but it looks like it's pulling it from the formats array property instead, thanks.
Your expectation is fulfilled: in line 244 of tableexport.js you will find the statement $.extend(true, defaults, options);
, which ensures that the values defined in the passed options parameter overwrite the corresponding values of the defaults object. The following code will then only work with the defaults object. Thus the passed format type is taken over as expected.
FYI, the three buttons that appear at the bottom of your table are not displayed by the Tableexport plugin. All the UI stuff you observe is provided by the bootstrap table export.
Thank you for the explanation. With this, I was able to see what I was doing incorrectly. It was an issue with my infrastructure and how I was referencing the plugin. Thank you for your time, now to get the plugin to working with XLSX 😁
I'm using tableExport with a bootstrap table and am trying to figure out why tableExport is only providing links to the default format values. Debugging myself I am seeing the tableExport method is called with the correct parameter but am unsure how it gets switched to the 3 default formats.
Attached is an image of what I'm seeing after selecting export as JSON.
Please let me know if there's any other additional information that I can provide.
EDIT: Additionally, when selecting the download type the buttons appear on the bottom of the table instead of just downloading the type selected in the dropdown. I'm only able to download using those buttons on the bottom of the table, is that intentional?