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

Selection feature breaking first column width #1685

Closed
wattsbn opened this issue Oct 2, 2014 · 3 comments
Closed

Selection feature breaking first column width #1685

wattsbn opened this issue Oct 2, 2014 · 3 comments
Assignees
Milestone

Comments

@wattsbn
Copy link
Contributor

wattsbn commented Oct 2, 2014

If you look at the selection feature in the docs, you can see the id column is about the size of the selection column. Even if you explicitly set its width, it will not be reflected in the grid. This is a recent issue. I have only noticed this within the last day or two.

@PaulL1
Copy link
Contributor

PaulL1 commented Oct 3, 2014

I saw this one earlier, and thought it had been resolved. I suspect it came about from this commit: #1609, fixing #1608. But I see in #1662 that Julie is having the same issue, so perhaps it didn't even fix that (although it no longer happens for me).

I wonder if the colDef is getting out of synch with the rowHeader, I unshifted the rowHeader to the front of the columns array, and perhaps somehow the size isn't getting applied to the right column. Is maybe the index off by one - I seem to recall at one point it was choosing to start the index at 1 instead of zero?

@PaulL1
Copy link
Contributor

PaulL1 commented Oct 3, 2014

Yes, I upgraded to latest and it's back in my application too. Looking at the grid, I can see that I have two columns with an index of 0. I thought I'd written code to renumber them all so that wouldn't happen. There is still some divergence in which order columns are created, depending on exactly when your data and columnDefs get set (I think). So sometimes the rowHeader is the first column created, and sometimes it's inserted when columns are already there. I think that's why the difference in behaviour in different scenarios.

PaulL1 added a commit to PaulL1/ng-grid that referenced this issue Oct 3, 2014
Removed col.index everywhere it appears, except for in the cell content
templates, which appear to use col.index in creating the cell class.

Added a column renumber to buildColumns to always give every column an
index starting at zero.
@PaulL1
Copy link
Contributor

PaulL1 commented Oct 3, 2014

Tentative fix, but still has a problem with headers on tutorial 113, so cannot yet be merged.

@PaulL1 PaulL1 added this to the 3.0 milestone Oct 3, 2014
@PaulL1 PaulL1 self-assigned this Oct 3, 2014
@PaulL1 PaulL1 closed this as completed in e8e31ce Oct 4, 2014
PaulL1 added a commit that referenced this issue Oct 4, 2014
Fix #1685: Remove col.index from most code, add col.uid
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

2 participants