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

Sticky column break, when multiple column use the same field #7215

Open
gonozalviii opened this issue Mar 7, 2024 · 1 comment
Open

Sticky column break, when multiple column use the same field #7215

gonozalviii opened this issue Mar 7, 2024 · 1 comment
Labels
Bug Issues which are marked as Bug needs example Need an example in order to confirm the issue or the PR.

Comments

@gonozalviii
Copy link

Bootstraptable version(s) affected

1.22.3

Description

I have configured 1 sticky column right, where I use a field "status" and a special formatter to display the status in color.
But I have another column that is not sticky that also uses "status" without a formatter.
So 2 column use the same field, one of them should be sticky.

The selecter in https://github.com/wenzhixin/bootstrap-table/blob/develop/src/extensions/fixed-columns/bootstrap-table-fixed-columns.js#L275 fetches the first column and uses its outerwidth instead of the second column which is sticky resulting in the sticky column to be too wide and displaying more than the last column as sticky.

Example(s)

No response

Possible Solutions

It might be better to not select the the column by "data-field", but to select all columns in the header (reverse it for 'isRight) and then iterate over over them to get the width.

this.$header.find("th").get().reverse()

Additional Context

No response

@gonozalviii gonozalviii added the Bug Issues which are marked as Bug label Mar 7, 2024
@wenzhixin
Copy link
Owner

Please provide an Online Example to show your problem. Thanks!

@wenzhixin wenzhixin added the needs example Need an example in order to confirm the issue or the PR. label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues which are marked as Bug needs example Need an example in order to confirm the issue or the PR.
Projects
None yet
Development

No branches or pull requests

2 participants