alhazmy13 / angular-csv-ext

Helper library for create CSV file in Angular.
MIT License
45 stars 23 forks source link

Random column order? #37

Open Abelhawk opened 5 years ago

Abelhawk commented 5 years ago

Hey, I was wondering what this library's algorithm is for ordering columns when exporting. On my end it seems to be random. Is there a way to assign a specific order for them to appear in in the CSV file?

madhav5589 commented 5 years ago

@Abelhawk So far what I have observed is that column order is the order in which you define the columns and assigns the value to each column. If you want the columns in specific order, define them in the same order. Hope it helps.

drwharris commented 5 years ago

It would be really nice if the parser followed the headers!

CAspeling commented 5 years ago

I've just run into this as well. It appears to be a javascript limitation. Easiest solution is to simply create a new array and as you construct it, insert data in desired order.