-
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
generating unique uids when column object is cached #2364
Comments
I see. If you supply the |
oh, thats interesting, thats certainly a better workaround than I am using (I just removed the track by). The col class stays the same as well, meaning that setting the field col causes a new uid generation (presumably due to some cache lookup somewhere?) whereas name doesn't? |
it still seems broken to me, it works as is because it is using the name property, if you switch the name property back to field it is still broken on the latest unstable |
Is it because you're using the same field name twice without giving them unique |
right, The issue I think is that the ngrepeat tracks by the name field so the same column object is used, but a unique uid is generated for the column. This creates a mismatch in the css where the column object expects a css class for the old uid but it no longer exists |
So what should we do if you supply |
That's what I went ahead and did. |
This is an odd but fairly serious bug that occurs when the user swaps out the columndefs array entirely but there are elements in this new array that share the same attribute as the previous columndefs array -- see this plunkr: http://plnkr.co/edit/LUFGq2Ri35xlewpPXqYW?p=preview
simply click swap, and watch the table disintegrate
In the above, the two schemes that the user swaps between both share the 'name' column. Due to the fact that the default uses 'track by col.colDef.name' the column isnt recompiled and subsequently the class isnt refreshed to reflect the new uid given to the column. What is refreshed to reflect the uid is the customStyles used to compile the inline css.
The text was updated successfully, but these errors were encountered: