tableExport.jquery.plugin icon indicating copy to clipboard operation
tableExport.jquery.plugin copied to clipboard

Export with data-filter-control="select" give select options in table header

Open thiazzz opened this issue 7 years ago • 6 comments

See attachments. The items in the dropdown appear in the exported excel sheet. tableExport-5.xlsx

screenshot 2018-01-10 22 36 08

thiazzz avatar Jan 10 '18 21:01 thiazzz

Hi thiazzz

i found the same problem you can resolve this with both methods

Declaring in th the data attribute

Just declare in th the data attribute data-tableexport-value = "new Column Name" this ll overwrite the column header and became this new name

Using Callback for parseSting

You can use the onCellHtmlData callback to parse this, as you can see:

$table.bootstrapTable({
          ...
            exportOptions: {
                onCellHtmlData: function (cell, rowIndex, colIndex, htmlData) {
                    return (htmlData.startsWith('<div') ? $(htmlData).html() : htmlData);
                }
            },
        ...
        });

This will get just the content html of all divs and exclude the options from select

I hope it helped you

augusto3691 avatar Mar 05 '18 17:03 augusto3691

ref https://github.com/wenzhixin/bootstrap-table/issues/4005

UtechtDustin avatar Apr 06 '19 17:04 UtechtDustin

Hello,

Bootstrap-table with bootstrap 4 does not work. Export + Filter Select option fail as thiazzz says. The items in the dropdown appear in the exported excel sheet

In the new online editor, In the new online editor, it doesn't work either.], it doesn't work either.

34796716-aeccc114-f656-11e7-86e6-1e9999db3857

XLS Result with error

jordiribes avatar Jun 19 '19 16:06 jordiribes

FYI: You are reporting this problem on the wrong project site. Bootstrap table uses a fork of kayalshri's plugin. I'm the author of that fork 😉

Edit: This problem should be fixed in v1.10.5 of the plugin and should be available as soon as this version is adopted by BT.

hhurz avatar Jun 19 '19 19:06 hhurz

I confirm this problem is fixed on Version 1.10.6 without using the proposal of augusto3691

youssefalaoui avatar Sep 11 '19 11:09 youssefalaoui

hello @thiazzz , you can check my example if you want https://github.com/Elhamassi/BootstrapTable/blob/master/index.html

Elhamassi avatar Jul 24 '20 14:07 Elhamassi