I want to change the filename that is used when using the Table Export extension. I know I can use the exportOptions to add {fileName:'custom_file_name'}. But I don't know where to put this.
I tried:
data-export-options="{fileName:'custom_file_name'}"
and I tried to add as a method:
$('#table').bootstrapTable('exportOptions', {fileName: 'custom_file_name'})
But then I get an error: Uncaught Error: Unknown method: exportOptionsenter code here
What am I missing?
You can add the following as a html table attribute:
data-export-options='{"fileName": "desired filename here"}'
Make sure you have the proper quotes and that the key is fileName with camelCase.
Use like this:
$('#table').bootstrapTable({
exportOptions: {
fileName: 'custom_file_name'
}
});
Now we do not support via data-attributes, docs: http://bootstrap-table.wenzhixin.net.cn/extensions/#table-export.
Example: http://jsfiddle.net/wenyi/e3nk137y/3365/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With