- Notifications
You must be signed in to change notification settings - Fork 2.4k
Excel export #6553
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
Excel export #6553
Conversation
…mn and add npm instructions Merge branch 'master' into excel_export # Conflicts: # misc/tutorial/410_excel_exporting_data_and_header.ngdoc
…porting with cellFilters
src/features/exporter/js/exporter.js Outdated
| // Width of 10 in excel is 75 pixels | ||
| var colWidths = []; | ||
| var startDataIndex = grid.treeBase ? grid.treeBase.numberLevels : 0; | ||
| var startDataIndex = grid.treeBase ? grid.treeBase.numberLevels : (grid.enableRowSelection !== false ? 1 : 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you checking for different than false rather than simply check for a truthy value?
grid.enableRowSelection? 1 : 0 There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it may be null. I was following the pattern already in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 361 selection.js
gridOptions.enableRowSelection = gridOptions.enableRowSelection !== false; There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that line in 361, ensures that enableRowSelection is a boolean from that point on. I don't believe there is ever a way to get into this function without running through 361 first. But if you feel strongly about keeping it this way, I won't hold your pull request because of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, I decided to separate your doc changes from your bug fix by doing a cherry pick and creating a new PR for the fix alone. I will add unit tests and merge it on its own, Then we can address the doc changes together.
| { field: 'member' }, | ||
| { field: 'total' } | ||
| { field: 'total' }, | ||
| { field: 'updatedDate', displayName: 'Date', cellFilter: 'date:\'yyyy-MM-dd\'', width: 150, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do these updates have to do with the bug that you are trying to fix?
| Is there a bug logged for the issue that you are attempting to fix? Also, would it be at all possible for you to add an unit test for you change? If not, I understand, but I would prefer it if we had one. |
Exporter was incorrectly exporting width of selection column. This is fixed.
Added example with date column and using cellFilters on export