Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not respect the order of the header #335

Closed
JimmyTMz opened this issue Feb 10, 2023 · 2 comments · Fixed by #375
Closed

Does not respect the order of the header #335

JimmyTMz opened this issue Feb 10, 2023 · 2 comments · Fixed by #375

Comments

@JimmyTMz
Copy link

JimmyTMz commented Feb 10, 2023

Hi
const columns = [
{ displayName: 'First', id: '1' },
{ displayName: 'Second', id: '1' },
{ displayName: 'Third', id: '3' }
]

If the information arrives [Third, Second, First] (axios), it is displayed in this way.
Expected result:
[First, Second, Third]

The header should order the order of the columns in the csv file

@dolezel
Copy link
Owner

dolezel commented Apr 7, 2023

Currently changing order for simple arrays does not work. You would need to return rows as {'3': 'Third', '2': 'Second', '1': 'First'}

@dolezel
Copy link
Owner

dolezel commented Oct 29, 2023

Now works with:

const columns = [
  { displayName: 'FirstC', id: '2' },
  { displayName: 'SecondC', id: '1' },
  { displayName: 'ThirdC', id: '0' },
]
const dataSet = [['ThirdD', 'SecondD', 'FirstD']]

Outputs:

FirstC,SecondC,ThirdC
FirstD,SecondD,ThirdD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants