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

[Grouping] "visible data" export - column order doesn't match #3332

Closed
meyerds opened this issue Apr 21, 2015 · 6 comments
Closed

[Grouping] "visible data" export - column order doesn't match #3332

meyerds opened this issue Apr 21, 2015 · 6 comments
Assignees
Milestone

Comments

@meyerds
Copy link

meyerds commented Apr 21, 2015

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

@PaulL1 PaulL1 added this to the Future milestone Apr 21, 2015
@PaulL1 PaulL1 self-assigned this Apr 21, 2015
@AgDude AgDude changed the title "visible data" export - column order doesn't match when grouping [Grouping] "visible data" export - column order doesn't match May 8, 2015
@AgDude
Copy link
Contributor

AgDude commented May 8, 2015

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.

@meyerds
Copy link
Author

meyerds commented May 20, 2015

I think it's a more general issue with export respecting column processors. A custom column processor + export test case would work great here.

@PaulL1
Copy link
Contributor

PaulL1 commented May 21, 2015

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.

@meyerds
Copy link
Author

meyerds commented May 21, 2015

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.

@PaulL1
Copy link
Contributor

PaulL1 commented May 21, 2015

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.

@PaulL1 PaulL1 closed this as completed in b63d7c2 May 21, 2015
@meyerds
Copy link
Author

meyerds commented May 26, 2015

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.

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

No branches or pull requests

3 participants