[ x ] bug
[ ] feature request
[ ] enhancement
column width should be updated properly after we update the model
column width is not affected if we update the model and it ends with a broken result.
Click on "add user" to add a user with a long name
https://plnkr.co/edit/1bW0DD?p=preview
Angular version: 4.2.5
Clarity version: "0.9.11
OS and version: windows 10
Browser: [all]
Unfortunately, this is expected behavior. We had complaints that columns were "jumping around" when we resized on every single model change. In particular, each page change is a model change, so users would move from page to page and the columns would change width every time. The UX recommendation is now that column widths are set "smartly" based on the initial models, and that we keep the same width as long as the columns are preserved.
In your case, if you have such disparity between the models present in a single column, I can see 3 solutions:
datagrid.resize() after updating the model: https://plnkr.co/edit/w1p7eDuf4Xumqky9H3jE?p=preview.name-cell {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
I'm closing this as wontfix since it's the expected behavior, but I hope the various solutions I offered (especially the first one) address your use case.
Hi there 馃憢, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.
Most helpful comment
Unfortunately, this is expected behavior. We had complaints that columns were "jumping around" when we resized on every single model change. In particular, each page change is a model change, so users would move from page to page and the columns would change width every time. The UX recommendation is now that column widths are set "smartly" based on the initial models, and that we keep the same width as long as the columns are preserved.
In your case, if you have such disparity between the models present in a single column, I can see 3 solutions:
datagrid.resize()after updating the model: https://plnkr.co/edit/w1p7eDuf4Xumqky9H3jE?p=previewNote that in this plunker, I had to wrap the resize in a timeout because I had to wait for the datagrid to actually go through change detection before resizing, otherwise the new row would simply not be in the DOM yet.
This works great when the long data is a paragraph of text, because you can give an approximate width and it will wrap if it's too long. But in your case with long unbreakable words, this solution would require perfect knowledge of the data in the column.
I'm closing this as
wontfixsince it's the expected behavior, but I hope the various solutions I offered (especially the first one) address your use case.