export-columns-order

lorin asked 2 months ago

Hi, I would like the export file (expecially XLS) generated by Yii2-export to mimic gridview by exporting all columns in order selected in gridview configuration popup menu.
I mean, lets have two columns A and B. In gridview configuration menu (Little wrench icon) I set that B comes first. My dynagrid output looks like following:

B title| A title
-------|---------
B data | A data
 
However the export completely ignores this setting and outputs A as first column (because it is defined first in columns array passed as configuration): 


A title  | B title
---------|----------
A data | B data


In DB, I have table tbl_dynagrid which should contain configuration of gridview. I found corresponding record with id gridview<pagename>_<userid>.
But the content of data column is not changing with reordering columns via gridview configuration.
Is there way how to load (preferably by PHP itself, without JS) order of columns and export to XLS file with that order in mind?

Thank you for help.

Login or register to contribute or comment.

Login   Register