Skip to content

Commit

Permalink
Fix download row order when using display true options (#1034)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielliwerant authored Oct 26, 2019
1 parent b26205a commit 7490ad1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/TableToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import PrintIcon from '@material-ui/icons/Print';
import ViewColumnIcon from '@material-ui/icons/ViewColumn';
import FilterIcon from '@material-ui/icons/FilterList';
import ReactToPrint from 'react-to-print';
import find from 'lodash.find';
import { withStyles } from '@material-ui/core/styles';
import { createCSVDownload } from '../utils';

Expand Down Expand Up @@ -109,9 +110,10 @@ class TableToolbar extends React.Component {
i += 1;

// if we have a custom render, which will appear as a react element, we must grab the actual value from data
// that matches the dataIndex and column
// TODO: Create a utility function for checking whether or not something is a react object
return typeof column === 'object' && column !== null && !Array.isArray(column)
? data[row.index].data[i]
? find(data, d => d.index === row.dataIndex).data[i]
: column;
}),
};
Expand Down

0 comments on commit 7490ad1

Please sign in to comment.