ellipses renderer causes truncated csv download

ellipses renderer causes truncated csv download

loukinglouking Posts: 259Questions: 52Answers: 0

Referencing https://datatables.net/blog/2016-02-26 I used the ellipses renderer described within. When I use the 'csv' button to download the the table which has a column field displayed with the ellipses renderer, I don't see the full field in the downloaded file. Rather I see what is rendered.

Is it possible to set up my table in such a way that the csv download will contain the full field?

Let me know if I need to construct jsbin/codepen for clarity.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,294Questions: 26Answers: 4,768

    It the Simple renderer section of the docs it explains this which would also affect data export:

    This is trivial to implement, but there are a few issues:
    - There is no indication to the end user that the data has been truncated
    - Search and ordering data will also be truncated.

    You will need to use the orthogonal data type display as shown in the example.

    Kevin

  • loukinglouking Posts: 259Questions: 52Answers: 0

    Not sure why lines 12-14 of the plugin under Ellipsis rendering plug-in do not achieve what you are saying about using the orthogonal data type display. So clearly I don't understand the suggestion you're making.

  • allanallan Posts: 61,695Questions: 1Answers: 10,102 Site admin
    Answer ✓

    If you want the full data to be exported rather than the ellipsis data (the render result), you need to use orthogonal data such as in this example.

    Because of this block in the ellipsis renderer:

            // Order, search and type get the original data
            if ( type !== 'display' ) {
                return d;
            }
    

    You could just do the same as the Buttons example above and set the orthogonal export data to export.

    Allan

  • loukinglouking Posts: 259Questions: 52Answers: 0

    That works, thanks!

This discussion has been closed.