Skip to content

Exporting FOOTER in csv with customFunction behaviour is broken!!! #1811

Description

@AndraPanait

BUG description:

  • if you have a function added inside the footer of one column : and you have just a couple of visible columns defined, the export of the csv footer is broken, i ll paste the code and tell you what the problem is!
    inside exporter.js you have this code for footer:
    if (!ignoreFooter) {
    content += '\n';
    content += visibleColumns.map(function (m, i) {
    if (typeof m.footer === 'function') {
    var columnData = _.pluck(data, columns[i].dataField);
    return '"' + m.footer(columnData, columns[i], i) + '"';
    } else if (m.footerFormatter) {
    return '"' + m.footerFormatter(columns[i], i) + '"';
    }
    return '"' + m.footer + '"';
    }).join(separator);
    }

what happens if visibleColums length is 7 and columns 10 for example?
columns[i] will be completely broken so ...all the code inside this function should be based on visibleColumns not on columns

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions