-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Grouping] "visible data" export - column order doesn't match #3332
Comments
I just put this into grouping, because that is where we will hit it in our app. I haven't looked into the cause yet, but is this a more general problem with export respecting column processors? We need to examine this more closely with a user defined column processor which changes the order. |
I think it's a more general issue with export respecting column processors. A custom column processor + export test case would work great here. |
Export does actually respect column order, I've added it to the 312 tutorial as an example. The problem is that it can only respect column order for visible columns - because those are the ones in the visible column cache. If it exports all columns then it has difficulty in getting them from the visible column cache, as that would only give the visible columns (I think strictly speaking the visible column cache may have all the columns in it with some marked invisible, but that is not guaranteed to continue - we did a performance optimisation on rows to remove all the invisible rows and we may do the same to columns). In short, if you want the columns in visible column order, the you should export visible columns. If you want all columns then you're stuck with getting them in the base column order. |
Going back to the Plunkr on the original issue post, looks like it might be a grouping-specific export issue then? When I export visible columns per your explanation, the export still isn't in the same order as it is in the grid. |
OK, I see the problem. Actually it's using the columns in both cases, and grouping moves the columns dynamically through a columns processor - it doesn't update the columns array (which allows us to go back to the column location pre-grouping when you ungroup again). Let me change the export to use visible column cache when exporting visible. |
Thanks for your work on this. In the plunkr on the original post, looks like this may not be fixed, still. The header order is correct now, but the body is out of order. |
When exporting "visible data" when grouping is active, the column order of the export may not match the column order of the grid.
This is due to grouping using a column processor to change the order of the grid columns; Grouping moves the grouped-by columns to the left side of the grid. The exporter doesn't use the visible column cache (output from the column processors) when building the visible column list.
http://plnkr.co/edit/MsgkxosmlXMojCOVPY96?p=preview
The text was updated successfully, but these errors were encountered: