Column-specific footerStyle added #7008
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔Type of Request
🔗Resolves an issue?
No
📝Changelog
Makes the footerStyle property available on columns, as an override of the table footerStyle property
Our team uses bootstrap-table on a variety of pages, so we've taken to making global formatters to use wherever. This works great for cell formatters (date, currency, etc...), footer formatters (sums mostly), and cell styles (colors, backgrounds).
These three properties are defined at the column level. The footerStyle property is an outlier, being defined for the entire table.
The column being passed to the callback as an argument feels like a workaround to apply different styles to different columns. It makes it difficult to create global formatters that include column-specific styles, because the column-specific logic has to be part of the function, and not the definition of the table. I hope I'm managing to convey the idea correctly.
This small ajustment allows defining the footerStyle on the column.
Naturally, the property can still be defined on the whole table, and this change will not break existing tables. This pull requests simply makes the property available on columns, in which case it'll override the global style formatter.
💡Example(s)?
Using both table-level and column-level footer styles: https://live.bootstrap-table.com/code/Blue3957/16322
☑️Self Check before Merge