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

Column-specific footerStyle added #7008

Merged
merged 1 commit into from
Oct 7, 2023
Merged

Column-specific footerStyle added #7008

merged 1 commit into from
Oct 7, 2023

Conversation

Blue3957
Copy link

@Blue3957 Blue3957 commented Oct 4, 2023

🤔Type of Request

  • Bug fix
  • New feature
  • Improvement
  • Documentation
  • Other

🔗Resolves an issue?
No

📝Changelog
Makes the footerStyle property available on columns, as an override of the table footerStyle property

  • Core
  • Extensions

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

⚠️ Please check all items below before reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

@Blue3957 Blue3957 changed the title feat (column options): column-specific footerStyle added Column-specific footerStyle added Oct 5, 2023
@wenzhixin wenzhixin merged commit 165ad0a into wenzhixin:develop Oct 7, 2023
1 check passed
@wenzhixin
Copy link
Owner

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants