Skip to content

Conversation

@monster910
Copy link
Contributor

Exporter was incorrectly exporting width of selection column. This is fixed.

Added example with date column and using cellFilters on export

// 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);
Copy link
Member

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 
Copy link
Contributor Author

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.

Copy link
Contributor Author

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; 
Copy link
Member

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.

Copy link
Member

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,
Copy link
Member

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?

@mportuga
Copy link
Member

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.

@mportuga mportuga merged commit bfbeeed into angular-ui:master Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants