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

Table is losing the configured columns width on filter, pagination, etc. #35

Open
uap-universe opened this issue Apr 6, 2022 · 3 comments
Labels
bug Something isn't working discussion-needed We need to decide what to do

Comments

@uap-universe
Copy link
Collaborator

In the table settings you can specify the desired width of a column,

However, when you use table filters or the pagination, the widths of the columns automatically adjust and seem to ignore the predefined widths (at least the new widths do not seem to come even close to what was configured).

This bug is very tricky to fix, because in contrast to the original ng2-smart-table, this fork of the smart-table supports changing the column width via drag&drop. I.e. we have to respect two settings: 1) the original width from the settings object and 2) a possible user defined width that has been selected at runtime.

I did not quite understand how the column resizing works (and imho it's very laggy and unpredictable), so I cannot provide a solution idea just yet.

@uap-universe uap-universe added bug Something isn't working discussion-needed We need to decide what to do labels Apr 6, 2022
@dj-fiorex
Copy link
Owner

i think that the best way is to ignore the original width from the settings when d&d is enabled, what do you think?

@uap-universe
Copy link
Collaborator Author

This would break many pre-configured tables as d&d is enabled by default. I need to investigate and understand more how the width of a column is maintained. There are so many factors that play into this. E.g. there is the use case of providing a custom renderer that uses text-overflow: ellipsis within a cell. That requires a certain width for the content div to properly work. Having the table auto-adjust for the content turns the logic around. So we have two conflicting approaches here: (1) the table wants to adjust the width of a column s.t. the content fits in and (2) the user wants to limit the width of a column and uses overflow properties (e.g. for previewing long texts).

I don't really know yet, what the most general solution would be to cover all cases.

@uap-universe
Copy link
Collaborator Author

uap-universe commented Jun 8, 2022

Maybe this is also resolved by #68

Update: or maybe not... a fixed table layout would be a breaking change for many users and is likely to cause cell overflows when the specified column width is not sufficient to contain the data (at least as long text-overflow: ellipsis is not default).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion-needed We need to decide what to do
Projects
None yet
Development

No branches or pull requests

2 participants