Sticky column break, when multiple column use the same field #7215
Labels
Bug
Issues which are marked as Bug
needs example
Need an example in order to confirm the issue or the PR.
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
The text was updated successfully, but these errors were encountered: