Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thiazzz opened this issue Jan 10, 2018 · 6 comments

Comments

@thiazzz
Copy link

thiazzz commented Jan 10, 2018

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

screenshot 2018-01-10 22 36 08

@augusto3691
Copy link

augusto3691 commented Mar 5, 2018

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

@UtechtDustin
Copy link

ref wenzhixin/bootstrap-table#4005

@jordiribes
Copy link

jordiribes commented Jun 19, 2019

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

@hhurz
Copy link

hhurz commented Jun 19, 2019

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.

@youssefalaoui
Copy link

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

@Elhamassi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants