Export the data on displayed

Export the data on displayed

monstakaramonstakara Posts: 3Questions: 1Answers: 0
edited May 2019 in Free community support

For example I have a table with some Column containing number 5, i change that column from "Inspect Elements" to number 10, when i export to CSV the value still number 5

so, how to export the table and keep number to 10?. Thanks..

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @monstakara ,

    That will depend on how you're changing the values. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • monstakaramonstakara Posts: 3Questions: 1Answers: 0

    Hi @colin ,

    Thanks for the answer, here i link to a test case live.datatables.net/daqohifa/1/edit .
    there i try to change column text from 5 to 10 by button "Change Column Text to 10" then i click export CSV button, from the export result the column text still number 5

  • colincolin Posts: 15,237Questions: 1Answers: 2,598
    edited May 2019 Answer ✓

    Hi @monstakara ,

    It's because you're changing the value in the DOM, but not notifying DataTables. You can either do that by using row().data() to change the data internally, or probably more simply just invalidate the table with cells().invalidate() like here.

    Cheers,

    Colin

  • monstakaramonstakara Posts: 3Questions: 1Answers: 0

    Hi @colin ,

    OMG, Thats the answer, I think it won't be easy. Thank you very much, You saved my day :blush:

This discussion has been closed.