How to get row data in export function?

How to get row data in export function?

altrackaaltracka Posts: 9Questions: 6Answers: 0

I want to modify the exported value for column 1 based on the value of column 2 in the same row. How can I get the row data? Here is what I've tried, but it gets the wrong row.

  exportOptions: {
    columns: [':visible'],
    format: {
      body: function (data, row, column, node) {
        if (column==1) {
    // This gets the wrong row, presumably because it doesn't take sorting into account:
            const rowData = table.row(row).data()
            if (rowData.foo==null) {
                return ''
            }
        }
        return data
      }
    },
    modifier: {
      selected: null
    },
  },

Answers

Sign In or Register to comment.