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

remove columns index error #591

Closed
simplyBarbe opened this issue Sep 27, 2021 · 0 comments · Fixed by #648
Closed

remove columns index error #591

simplyBarbe opened this issue Sep 27, 2021 · 0 comments · Fixed by #648

Comments

@simplyBarbe
Copy link

simplyBarbe commented Sep 27, 2021

when using the remove columns there is a problem with the index

in the example below the last colum(13) is not removed in the excel, i tried using 12 and works, but the real index is 13.

I tried passing [0,0] to the function and it removes column 0 and 1.
I think the function try to remove a index that is not correct because previous column are removed and index changed

       function exportSome() {
            return ExcellentExport.convert({
                anchor: "anchorNewApi-xlsx-some",
                filename: "export_Commesse",
                format: "xlsx",
                openAsDownload: true
            }, [{
                name: 'commesse',
                from: {
                    table: 'ContentPlaceHolder1_TableCommesse'
                },
                removeColumns: [0, 6, 10, 13],
                fixValue: (value, row, col) => {

                    if (col == ($("#ContentPlaceHolder1_TableCommesse")[0].rows[0].cells.length - 5)) {
                        if (row > 0) {
                            var doc = new DOMParser().parseFromString(value, "text/xml");
                            return doc.firstChild.getAttribute("data-original-title");
                        }
                    }

                    return value.replace(/(<([^>]+)>)/gi, "");
                }
            }])
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants