We are using row selection in the grid and have discovered a significant issue when the following steps are taken:
Here is a partial screenshot after step 1
If the grid is reloaded with an empty array, the selector is removed:
The red arrow shows an additional anomaly where the set of fixed columns that is supposed to be on the right side is moved over by the width of the selector column.
Finally, if the grid is reloaded with one or more valid rows, all of the column configuration is lost:
It appears that the cause is the removal and then re-addition of the selector column.
Is it possible for us to change the behavior so that the column is never removed? Or can the grid be fixed not to lose the column information in this scenario?
This is a fairly critical issue since we cannot release our updated application using this grid until the issue is addressed.
Hello,
The square brackets, [], cause Angular to evaluate the right-hand side of the assignment as a dynamic expression. Without the brackets, Angular treats the right-hand side as a string literal and sets the property to that static value. So, for example, if you set the autoGenerate property as autoGenerate = "false", the right side would be evaluated as True, since "false" would be treated as non-empty string. When you add a square brackets around the autoGenerate i.e. [autoGenerate] = "false" this would invoke an evaluation of the right expression to the value False.
More about Angular property binding could be found here. Also a useful topic could be the Angular template syntax which could be found here.
Let me know if I may be of any further assistance.
Sincerely,
Teodosia Hristodorova
Associate Software Developer
Ah, that is fantastic and does solve the problem, thank you!
Is there a general rule about when the brackets should be supplied and when they shouldn't? I have seen a wide variation and haven't really been able to figure out which usage is correct in which circumstances.
After an investigation I have determined that the reason for the issue came from missing brackets around the autoGenerate property:
[autoGenerate]="false"
Also, since the displayDensity is set to compact, the min-width of the rowSelectors column should be calculated as calc(1.25rem + (0.75rem * 2)) instead of calc(1.25rem + (1.5rem * 2)).
I have modified the previously provided sample and it could be found here.
Please test it on your side and let me know if I may be of any further assistance.
Is there any update on this issue? This is an absolutely critical problem for us.
Thank you for the response and sample. Unfortunately, I am able to reproduce this at will using the sample once I set autogenerate to false.
I have updated the sample here
If that doesn't work, you should be able to set autogenerate to false, select load empty data first, then look at the column headers. They should display the name of the field, not the caption: